diff options
author | Alexander Larsson <alexl@redhat.com> | 2015-11-11 16:06:44 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2015-11-11 16:06:44 +0100 |
commit | 51dc4873fd8b4d4f14f902870b6110dd70a224e3 (patch) | |
tree | e56983907037a8e27007d27d551af9e8fd04eb0f /tests | |
parent | 402225a8e23bcff118055568ca79f4b73a3951f8 (diff) | |
download | gtk+-51dc4873fd8b4d4f14f902870b6110dd70a224e3.tar.gz |
Add gtk_native_dialog_destroy()
Its very easy to get extra references to the NativeDialog so that
when you release your last reference any visible dialog is not
hidden. We handle this by adding a destroy method similar to how
you destroy regular toplevels.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testgtk.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index 7dec326bcc..d00e7f7cad 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -9660,6 +9660,13 @@ native_filter_changed (GtkWidget *combo, } } +static void +destroy_native (GtkFileChooserNative *native) +{ + gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (native)); + g_object_unref (native); +} + void create_native_dialogs (GtkWidget *widget) { @@ -9681,7 +9688,7 @@ create_native_dialogs (GtkWidget *widget) "_accept&native", "_cancel__native"); - g_signal_connect_swapped (G_OBJECT (window), "destroy", G_CALLBACK (g_object_unref), native); + g_signal_connect_swapped (G_OBJECT (window), "destroy", G_CALLBACK (destroy_native), native); gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (native), g_get_current_dir (), |