Created
March 18, 2012 19:15
-
-
Save aalinat/2079958 to your computer and use it in GitHub Desktop.
other variation of pygtk window creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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