Replace all remaining uses of delete-event

This commit is contained in:
Matthias Clasen 2018-01-01 15:27:16 -05:00
parent a739ee6905
commit 41e4c93443
9 changed files with 12 additions and 18 deletions

View File

@ -163,7 +163,6 @@ main (gint argc, gchar **argv)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), main_box); gtk_container_add (GTK_CONTAINER (window), main_box);

View File

@ -299,7 +299,7 @@ main (int argc, char *argv[])
gtk_init (); gtk_init ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "delete_event", gtk_main_quit, NULL); g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_add (GTK_CONTAINER (window), vbox);

View File

@ -110,8 +110,7 @@ main (int argc, char **argv)
model = create_model (); model = create_model ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "delete_event", g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_default_size (GTK_WINDOW (window), 320, 480); gtk_window_set_default_size (GTK_WINDOW (window), 320, 480);
sw = gtk_scrolled_window_new (NULL, NULL); sw = gtk_scrolled_window_new (NULL, NULL);

View File

@ -2682,7 +2682,8 @@ static GtkWidget *sw_float_parent;
static gulong sw_destroyed_handler = 0; static gulong sw_destroyed_handler = 0;
static gboolean static gboolean
scrolled_windows_delete_cb (GtkWidget *widget, GdkEventAny *event, GtkWidget *scrollwin) scrolled_windows_delete_cb (GtkWidget *widget,
GtkWidget *scrollwin)
{ {
g_object_ref (scrollwin); g_object_ref (scrollwin);
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (scrollwin)), scrollwin); gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (scrollwin)), scrollwin);
@ -2751,7 +2752,7 @@ scrolled_windows_remove (GtkWidget *dialog, gint response, GtkWidget *scrollwin)
sw_destroyed_handler = sw_destroyed_handler =
g_signal_connect (sw_parent, "destroy", g_signal_connect (sw_parent, "destroy",
G_CALLBACK (scrolled_windows_destroy_cb), scrollwin); G_CALLBACK (scrolled_windows_destroy_cb), scrollwin);
g_signal_connect (sw_float_parent, "delete_event", g_signal_connect (sw_float_parent, "close-request",
G_CALLBACK (scrolled_windows_delete_cb), scrollwin); G_CALLBACK (scrolled_windows_delete_cb), scrollwin);
} }
} }

View File

@ -793,8 +793,7 @@ test_clicked (GtkWidget *button,
interface->window = (GtkWidget *)gtk_builder_get_object (builder, "window"); interface->window = (GtkWidget *)gtk_builder_get_object (builder, "window");
g_signal_connect (interface->window, "delete_event", gtk_window_set_hide_on_close (GTK_WINDOW (interface->window), TRUE);
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
g_object_unref (builder); g_object_unref (builder);
} }

View File

@ -26,8 +26,7 @@ kinetic_scrolling (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400); gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
g_signal_connect (window, "delete_event", g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
G_CALLBACK (gtk_main_quit), NULL);
grid = gtk_grid_new (); grid = gtk_grid_new ();

View File

@ -21,9 +21,7 @@
static gint num_windows = 0; static gint num_windows = 0;
static gboolean static gboolean
on_delete_event (GtkWidget *w, on_delete (GtkWindow *w)
GdkEvent *event,
gpointer user_data)
{ {
num_windows--; num_windows--;
if (num_windows == 0) if (num_windows == 0)
@ -39,7 +37,7 @@ prepare_window_for_orientation (GtkOrientation orientation)
int max; int max;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); g_signal_connect (window, "close-request", G_CALLBACK (on_delete), NULL);
mainbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); mainbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_container_add (GTK_CONTAINER (window), mainbox); gtk_container_add (GTK_CONTAINER (window), mainbox);

View File

@ -679,7 +679,7 @@ main (gint argc, gchar **argv)
gtk_widget_show (window); gtk_widget_show (window);
g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (toolbar, "popup_context_menu", G_CALLBACK (popup_context_menu), NULL); g_signal_connect (toolbar, "popup_context_menu", G_CALLBACK (popup_context_menu), NULL);

View File

@ -298,8 +298,7 @@ main (int argc, char *argv[])
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Tooltips test"); gtk_window_set_title (GTK_WINDOW (window), "Tooltips test");
g_signal_connect (window, "delete_event", g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
G_CALLBACK (gtk_main_quit), NULL);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_container_add (GTK_CONTAINER (window), box); gtk_container_add (GTK_CONTAINER (window), box);