quit when main window closes

This commit is contained in:
Brandon Lewis 2010-07-19 19:39:26 +02:00 committed by Edward Hervey
parent b7687c5126
commit d4abb899ae
2 changed files with 10 additions and 65 deletions

View file

@ -1,5 +1,11 @@
#include <gtk/gtk.h>
void
window_destroy_cb (GtkObject * window, gpointer user)
{
gtk_main_quit ();
}
int
main (int argc, char *argv[])
{
@ -10,6 +16,7 @@ main (int argc, char *argv[])
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "ges-ui.glade", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));
gtk_widget_show (window);

View file

@ -10,7 +10,8 @@
<column type="guint64"/>
</columns>
</object>
<object class="GtkWindow" id="window1">
<object class="GtkWindow" id="window">
<signal name="destroy" handler="window_destroy_cb"/>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
@ -152,70 +153,7 @@
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<child>
<object class="GtkRadioButton" id="radiobutton1">
<property name="label" translatable="yes">radiobutton</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox1">
<property name="visible">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<child>
<object class="GtkRadioButton" id="radiobutton2">
<property name="label" translatable="yes">radiobutton</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox2">
<property name="visible">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
<placeholder/>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">