forked from AuroraMiddleware/gtk
testgmenu: Quit on delete-event
This commit is contained in:
parent
95d9a5e368
commit
e0c235255b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user