Enter exit button

git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@233 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
hploetz 2007-06-09 00:42:34 +00:00
parent c684d3632c
commit 49d912cbd8
2 changed files with 57 additions and 0 deletions

View File

@ -26,6 +26,17 @@ class PassportGUI:
self.now_showing = 0
self.main_window_xml = gtk.glade.XML(self.GLADE_FILE, "main")
self.main_window = self.main_window_xml.get_widget("main")
signals = {
"on_exit_clicked": self.exit_clicked,
"on_main_delete_event": self.exit_clicked,
"on_main_destroy": gtk.main_quit,
}
self.main_window_xml.signal_autoconnect(signals)
def exit_clicked(self, widget, event=None, data=None):
gtk.main_quit()
return True
def run(self):
gtk.gdk.threads_init()

View File

@ -19,6 +19,8 @@
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<signal name="destroy" handler="on_main_destroy" last_modification_time="Sat, 09 Jun 2007 00:37:48 GMT"/>
<signal name="delete_event" handler="on_main_delete_event" last_modification_time="Sat, 09 Jun 2007 00:41:46 GMT"/>
<child>
<widget class="GtkTable" id="passport_data_page">
@ -912,6 +914,50 @@ Nationality</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkButton" id="exit">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="label">gtk-quit</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_exit_clicked" last_modification_time="Sat, 09 Jun 2007 00:36:17 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">6</property>
<property name="top_attach">18</property>
<property name="bottom_attach">19</property>
<property name="x_options">fill</property>
</packing>
</child>
</widget>
</child>
</widget>