diff options
author | Colin Walters <walters@verbum.org> | 2011-11-21 09:58:37 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2011-12-19 12:45:51 -0500 |
commit | e0c235255b98b69a3d835997ab6f65b81079e9cf (patch) | |
tree | 21d44205053ed454b5c53b943b37cfcde58df113 /tests | |
parent | 95d9a5e3688767dcd2794ae4027be02ccc084746 (diff) | |
download | gtk+-e0c235255b98b69a3d835997ab6f65b81079e9cf.tar.gz |
testgmenu: Quit on delete-event
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testgmenu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/testgmenu.c b/tests/testgmenu.c index 1908402990..4674362fc9 100644 --- a/tests/testgmenu.c +++ b/tests/testgmenu.c @@ -921,6 +921,15 @@ button_clicked (GtkButton *button, #define BUS_NAME "org.gtk.TestMenus" #define OBJ_PATH "/org/gtk/TestMenus" +static gboolean +on_delete_event (GtkWidget *widget, + GdkEvent *event, + gpointer user_data) +{ + gtk_main_quit (); + return TRUE; +} + int main (int argc, char *argv[]) { @@ -951,6 +960,7 @@ main (int argc, char *argv[]) } window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_signal_connect (window, "delete-event", G_CALLBACK(on_delete_event), NULL); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_container_add (GTK_CONTAINER (window), box); |