mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-23 20:30:15 +00:00
demo: Fix "Expander" demonstration
The expander window is not a dialog anymore, so attempting connecting to its "response" is invalid and throws a critical: signal 'response' is invalid for instance '<PTR>' of type 'GtkWindow'
This commit is contained in:
parent
ac37d66bd5
commit
56f0735e2b
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user