import pygtk import gtk class WindowMain: def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.button_close = gtk.Button("Pritisni me da se zaprem") self.button_close.connect("clicked", self.button_close_clicked) self.window.add(self.button_close) self.window.show_all() def main(self): gtk.main() def button_close_clicked(self, button): print "V tem trenutku bi se moral zapreti." window_main = WindowMain() window_main.main()