Advertisement
themoosemind

GTK2 - simple application

Mar 23rd, 2015
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # example base.py
  3. import pygtk
  4. pygtk.require('2.0')
  5. import gtk
  6.  
  7.  
  8. class Base:
  9.     def __init__(self):
  10.         self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
  11.         self.window.connect("destroy", self.destroy)
  12.         self.window.show()
  13.  
  14.     def destroy(self, widget, data=None):
  15.         gtk.main_quit()
  16.  
  17.     def main(self):
  18.         gtk.main()
  19. print(__name__)
  20.  
  21. if __name__ == "__main__":
  22.     base = Base()
  23.     base.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement