From: Uwe Hermann Date: Tue, 16 Apr 2013 18:24:34 +0000 (+0200) Subject: Handle GTK+ signals via glade too. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2f5ef701f2332bc47132955dadc5baf646d673d9;p=sigrok-meter.git Handle GTK+ signals via glade too. --- diff --git a/sigrok-meter b/sigrok-meter index b2d459c..9711c83 100755 --- a/sigrok-meter +++ b/sigrok-meter @@ -21,11 +21,15 @@ from gi.repository import Gtk +# Handler class for various GTK+ signals. +class Handler: + def onDeleteWindow(self, *args): + Gtk.main_quit(*args) + builder = Gtk.Builder() builder.add_from_file("sigrok-meter.glade") - +builder.connect_signals(Handler()) win = builder.get_object("main-window") -win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() diff --git a/sigrok-meter.glade b/sigrok-meter.glade index 6907ef1..5456512 100644 --- a/sigrok-meter.glade +++ b/sigrok-meter.glade @@ -3,6 +3,7 @@ False +