]> sigrok.org Git - sigrok-meter.git/commitdiff
Handle GTK+ signals via glade too.
authorUwe Hermann <redacted>
Tue, 16 Apr 2013 18:24:34 +0000 (20:24 +0200)
committerUwe Hermann <redacted>
Tue, 16 Apr 2013 18:04:10 +0000 (20:04 +0200)
sigrok-meter
sigrok-meter.glade

index b2d459c0b5bec53adb7cb1f2d05a6b3b2dd6d2c7..9711c83a0cfc1f25e286ad81260220a871e6177d 100755 (executable)
 
 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()
 
index 6907ef1a2cb410bdcbfe33986ae04d10e8a27da6..5456512d71858b816ef165a44cd3ef47d208236f 100644 (file)
@@ -3,6 +3,7 @@
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkWindow" id="main-window">
     <property name="can_focus">False</property>
+    <signal name="delete-event" handler="onDeleteWindow" swapped="no"/>
     <child>
       <placeholder/>
     </child>