Skip to content

Instantly share code, notes, and snippets.

@aalinat
Created March 18, 2012 19:15
Show Gist options
  • Save aalinat/2079958 to your computer and use it in GitHub Desktop.
Save aalinat/2079958 to your computer and use it in GitHub Desktop.
other variation of pygtk window creation
import gtk
class Podcaster(gtk.Window):
def __init__(self):
super(Podcaster, self).__init__()
self.set_position(gtk.WIN_POS_CENTER)
self.connect("destroy", gtk.main_quit)
self.set_title("Podcaster")
self.connect("destroy", self.destroy)
self.set_default_size(300,300)
self.button = gtk.Button("Hello World")
self.button.connect("clicked", self.hello, None)
self.add(self.button)
self.show_all()
def hello(self, widget, data=None):
md = gtk.MessageDialog(self,
gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
gtk.BUTTONS_CLOSE, "Download completed")
md.run()
md.destroy()
if __name__ == "__main__":
Podcaster()
gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment