MyTetra Share
Делитесь знаниями!
simple example
Время создания: 01.05.2017 00:48
Раздел: Python - PyGTK
Запись: xintrea/mytetra_db_mcold/master/base/149358892672v6yygo43/text.html на raw.githubusercontent.com
# coding: utf-8
import gi
gi.require_version(
'Gtk', '3.0')
from gi.repository import Gtk

class MyWindow(Gtk.Window):

def __init__(self):
Gtk.Window.
__init__(self, title="Hello World")

self.button = Gtk.Button(label="Click Here")
self.button.connect("clicked", self.on_button_clicked)
self.add(self.button)

def on_button_clicked(self, widget):
print("Hello World")

win = MyWindow()
win.connect(
"delete-event", Gtk.main_quit) # connecting to the window’s delete event to ensure that the application is terminated if we click on the x to close the window.
win.show_all() # display the window
Gtk.main() # start the GTK+ processing loop which we quit when the window is closed
 
MyTetra Share v.0.65
Яндекс индекс цитирования