diff options
Diffstat (limited to 'python-gnome-app')
| -rwxr-xr-x | python-gnome-app | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/python-gnome-app b/python-gnome-app index 09625d3..440e95f 100755 --- a/python-gnome-app +++ b/python-gnome-app @@ -1,8 +1,21 @@ #!/usr/bin/python3 +import sys from gi.repository import Gtk -window = Gtk.Window() -window.show_all() -Gtk.main() +class PythonApp(Gtk.Application): + + def __init__(self): + Gtk.Application.__init__( + self, application_id="org.example.PythonGnome") + + self.connect("activate", self.on_activate) + + def on_activate(self, app): + window = Gtk.ApplicationWindow(application=app) + window.show_all() + +app = PythonApp() +exit_status = app.run(None) +sys.exit(exit_status) |
