diff --git a/demos/gtk-demo/expander.c b/demos/gtk-demo/expander.c index c374175c27..b6d6ba4846 100644 --- a/demos/gtk-demo/expander.c +++ b/demos/gtk-demo/expander.c @@ -12,11 +12,13 @@ static GtkWidget *window = NULL; -static void -response_cb (GtkDialog *dialog, int response_id) +static gboolean +close_request_cb (GtkWidget *win, gpointer user_data) { - gtk_window_destroy (GTK_WINDOW (window)); + g_assert (window == win); + gtk_window_destroy ((GtkWindow *)window); window = NULL; + return TRUE; } static void @@ -117,7 +119,7 @@ do_expander (GtkWidget *do_widget) g_signal_connect (expander, "notify::expanded", G_CALLBACK (expander_cb), window); - g_signal_connect (window, "response", G_CALLBACK (response_cb), NULL); + g_signal_connect (window, "close-request", G_CALLBACK (close_request_cb), NULL); } if (!gtk_widget_get_visible (window))