Created
December 28, 2014 23:38
-
-
Save Seth-Johnson/9072d70b61f3b7da74d6 to your computer and use it in GitHub Desktop.
Gtk testing stuff
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
from gi.repository import Gtk | |
win = None | |
class MyFirstWindow(Gtk.Window): | |
def __init__(self): | |
Gtk.Window.__init__(self, title="First Class") | |
self.button1 = Gtk.Button(label="Click me. Quick!") | |
self.button1.connect("clicked", self.on_button_clicked) | |
self.add(self.button1) | |
def on_button_clicked(self, widget): | |
win = MySecondWindow() | |
win.show_all() | |
class MySecondWindow(Gtk.Window): | |
def __init__(self): | |
Gtk.Window.__init__(self, title="Second class") | |
self.button2 = Gtk.Button(label="Don't click me!") | |
self.add(self.button2) | |
win = MyFirstWindow() | |
win.connect("delete-event", Gtk.main_quit) | |
win.show_all() | |
Gtk.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment