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()
<!-- 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>