Use gtk_window_destroy

Replace calls to gtk_widget_destroy on windows
with gtk_window_destroy.
This commit is contained in:
Matthias Clasen 2020-05-09 10:26:22 -04:00
parent 48821a64d0
commit cd0081d08a
137 changed files with 364 additions and 368 deletions

View File

@ -317,7 +317,7 @@ save_response_cb (GtkNativeDialog *dialog,
"Saving failed");
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message_dialog),
"%s", error->message);
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (message_dialog);
g_error_free (error);
}
@ -403,7 +403,7 @@ constraint_editor_done (ConstraintEditor *editor,
g_clear_object (&old_constraint);
gtk_widget_destroy (gtk_widget_get_ancestor (GTK_WIDGET (editor), GTK_TYPE_WINDOW));
gtk_window_destroy (GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (editor), GTK_TYPE_WINDOW)));
}
static void
@ -444,7 +444,7 @@ guide_editor_done (GuideEditor *editor,
GtkConstraintGuide *guide,
ConstraintEditorWindow *win)
{
gtk_widget_destroy (gtk_widget_get_ancestor (GTK_WIDGET (editor), GTK_TYPE_WINDOW));
gtk_window_destroy (GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (editor), GTK_TYPE_WINDOW)));
}
static void

View File

@ -47,7 +47,7 @@ show_action_dialog (GSimpleAction *action)
name);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (dialog);
}
@ -120,7 +120,7 @@ open_response_cb (GtkNativeDialog *dialog,
"Error loading file: \"%s\"",
error->message);
g_signal_connect (message_dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (message_dialog);
g_error_free (error);
}
@ -234,7 +234,7 @@ activate_quit (GSimpleAction *action,
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
gtk_window_destroy (GTK_WINDOW (win));
list = next;
}

View File

@ -26,7 +26,7 @@ apply_changes_gradually (gpointer data)
else
{
/* Close automatically once changes are fully applied. */
gtk_widget_destroy (data);
gtk_window_destroy (GTK_WINDOW (data));
return G_SOURCE_REMOVE;
}
}
@ -41,7 +41,7 @@ on_assistant_apply (GtkWidget *widget, gpointer data)
static void
on_assistant_close_cancel (GtkWidget *widget, gpointer data)
{
gtk_widget_destroy (widget);
gtk_window_destroy (GTK_WINDOW (widget));
}
static void
@ -198,7 +198,7 @@ do_assistant (GtkWidget *do_widget)
if (!gtk_widget_get_visible (assistant))
gtk_widget_show (assistant);
else
gtk_widget_destroy (assistant);
gtk_window_destroy (GTK_WINDOW (assistant));
return assistant;
}

View File

@ -12,7 +12,7 @@ quit_activate (GSimpleAction *action,
{
GtkWidget *window = user_data;
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
}
static void
@ -87,7 +87,7 @@ do_builder (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -69,7 +69,7 @@ paste_received (GObject *source_object,
"Could not paste text: %s",
error->message);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (dialog);
g_error_free (error);
@ -185,7 +185,7 @@ do_clipboard (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -448,7 +448,7 @@ do_combobox (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -277,13 +277,13 @@ do_constraints (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_set_hexpand (grid, TRUE);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window);
G_CALLBACK (gtk_window_destroy), window);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -233,13 +233,13 @@ do_constraints2 (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_set_hexpand (grid, TRUE);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window);
G_CALLBACK (gtk_window_destroy), window);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -153,13 +153,13 @@ do_constraints3 (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_set_hexpand (grid, TRUE);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window);
G_CALLBACK (gtk_window_destroy), window);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -62,7 +62,7 @@ do_css_accordion (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -112,7 +112,7 @@ do_css_basics (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -140,7 +140,7 @@ do_css_blendmodes (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -152,7 +152,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -119,7 +119,7 @@ do_css_pixbufs (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -137,7 +137,7 @@ do_css_shadows (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -36,7 +36,7 @@ do_cursors (GtkWidget *do_widget)
gtk_widget_show (window);
else
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
}
return window;

View File

@ -26,7 +26,7 @@ message_dialog_clicked (GtkButton *button,
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%d", i);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
i++;
}
@ -89,7 +89,7 @@ interactive_dialog_clicked (GtkButton *button,
gtk_editable_set_text (GTK_EDITABLE (entry2), gtk_editable_get_text (GTK_EDITABLE (local_entry2)));
}
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
}
GtkWidget *
@ -168,7 +168,7 @@ do_dialog (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -492,7 +492,7 @@ do_dnd (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -260,7 +260,7 @@ do_drawingarea (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -409,7 +409,7 @@ do_editable_cells (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -86,7 +86,7 @@ do_entry_completion (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -48,7 +48,7 @@ do_entry_undo (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -15,7 +15,7 @@ static GtkWidget *window = NULL;
static void
response_cb (GtkDialog *dialog, gint response_id)
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
window = NULL;
}
@ -90,7 +90,7 @@ do_expander (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -198,7 +198,7 @@ do_filtermodel (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -288,7 +288,7 @@ do_fishbowl (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -161,7 +161,7 @@ do_fixed (GtkWidget *do_widget)
if (!gtk_widget_get_visible (demo_window))
gtk_widget_show (demo_window);
else
gtk_widget_destroy (demo_window);
gtk_window_destroy (GTK_WINDOW (demo_window));
return demo_window;
}

View File

@ -743,7 +743,7 @@ do_flowbox (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -1343,7 +1343,7 @@ do_font_features (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_window_present (GTK_WINDOW (window));
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -281,7 +281,7 @@ do_fontrendering (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -131,7 +131,7 @@ do_gears (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -209,7 +209,7 @@ do_gestures (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -427,7 +427,7 @@ create_glarea_window (GtkWidget *do_widget)
button = gtk_button_new_with_label ("Quit");
gtk_widget_set_hexpand (button, TRUE);
gtk_container_add (GTK_CONTAINER (box), button);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window);
return window;
}
@ -441,7 +441,7 @@ do_glarea (GtkWidget *do_widget)
if (!gtk_widget_get_visible (demo_window))
gtk_widget_show (demo_window);
else
gtk_widget_destroy (demo_window);
gtk_window_destroy (GTK_WINDOW (demo_window));
return demo_window;
}

View File

@ -58,7 +58,7 @@ do_headerbar (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -273,7 +273,7 @@ do_hypertext (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -223,7 +223,7 @@ do_iconscroll (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -228,7 +228,7 @@ home_clicked (GtkButton *item,
static void close_window(void)
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
window = NULL;
g_object_unref (file_pixbuf);
@ -320,7 +320,7 @@ do_iconview (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -150,7 +150,7 @@ do_iconview_edit (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -91,7 +91,7 @@ progressive_timeout (gpointer data)
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
g_object_unref (image_stream);
image_stream = NULL;
@ -119,7 +119,7 @@ progressive_timeout (gpointer data)
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
g_object_unref (image_stream);
image_stream = NULL;
@ -152,7 +152,7 @@ progressive_timeout (gpointer data)
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (dialog);
@ -189,7 +189,7 @@ progressive_timeout (gpointer data)
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (dialog);
@ -223,7 +223,7 @@ progressive_timeout (gpointer data)
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (dialog);
@ -471,7 +471,7 @@ do_images (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -29,10 +29,8 @@ on_bar_response (GtkInfoBar *info_bar,
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"Your response has id %d", response_id);
g_signal_connect_swapped (dialog,
"response",
G_CALLBACK (gtk_widget_destroy),
dialog);
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_window_destroy), dialog);
gtk_widget_show (dialog);
}
@ -148,7 +146,7 @@ do_infobar (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -12,7 +12,7 @@ response_cb (GtkWidget *dialog,
gint response_id,
gpointer data)
{
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
}
static gboolean
@ -87,7 +87,7 @@ do_links (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -307,7 +307,7 @@ do_list_store (GtkWidget *do_widget)
}
else
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
window = NULL;
if (timeout != 0)
{

View File

@ -387,7 +387,7 @@ do_listbox (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -101,7 +101,7 @@ activate_quit (GSimpleAction *action,
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
gtk_window_destroy (GTK_WINDOW (win));
list = next;
}

View File

@ -125,7 +125,7 @@ do_markup (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -58,7 +58,7 @@ do_modelbutton (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;

View File

@ -85,7 +85,7 @@ do_overlay (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -95,7 +95,7 @@ do_overlay2 (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -11,7 +11,7 @@
static void
done_cb (GtkDialog *dialog, gint response, gpointer data)
{
gtk_widget_destroy (GTK_WIDGET (dialog));
gtk_window_destroy (GTK_WINDOW (dialog));
}
GtkWidget *
@ -29,7 +29,7 @@ do_pagesetup (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -411,7 +411,7 @@ do_paint (GtkWidget *toplevel)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -171,7 +171,7 @@ do_paintable (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -203,7 +203,7 @@ do_paintable_animated (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -306,7 +306,7 @@ do_paintable_mediastream (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -202,7 +202,7 @@ do_panes (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -74,7 +74,7 @@ do_password_entry (GtkWidget *do_widget)
button = gtk_button_new_with_mnemonic ("_Done");
gtk_widget_add_css_class (button, "suggested-action");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window);
gtk_widget_set_sensitive (button, FALSE);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
@ -84,7 +84,7 @@ do_password_entry (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -348,7 +348,7 @@ do_peg_solitaire (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -75,7 +75,7 @@ do_pickers (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -196,7 +196,7 @@ do_pixbufs (GtkWidget *do_widget)
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (dialog);
}
@ -220,7 +220,7 @@ do_pixbufs (GtkWidget *do_widget)
gtk_widget_show (window);
else
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
g_object_unref (frame);
}

View File

@ -188,7 +188,7 @@ do_printing (GtkWidget *do_widget)
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (dialog);
}

View File

@ -85,7 +85,7 @@ do_revealer (GtkWidget *do_widget)
}
else
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
}

View File

@ -212,7 +212,7 @@ do_rotated_text (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -29,7 +29,7 @@ do_scale (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;

View File

@ -319,7 +319,7 @@ do_search_entry (GtkWidget *do_widget)
else
{
g_clear_object (&actions);
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
}
return window;

View File

@ -143,7 +143,7 @@ do_search_entry2 (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -86,7 +86,7 @@ do_shortcut_triggers (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -97,7 +97,7 @@ do_shortcuts (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -78,7 +78,7 @@ do_sidebar (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -160,7 +160,7 @@ do_sizegroup (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -471,7 +471,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -237,7 +237,7 @@ do_spinbutton (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -45,7 +45,7 @@ do_spinner (GtkWidget *do_widget)
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
@ -92,7 +92,7 @@ do_spinner (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -29,7 +29,7 @@ do_stack (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;

View File

@ -51,7 +51,7 @@ do_tabs (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -98,7 +98,7 @@ do_tagged_entry (GtkWidget *do_widget)
button = gtk_button_new_with_mnemonic ("_Done");
gtk_widget_add_css_class (button, "suggested-action");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
gtk_window_set_default_widget (GTK_WINDOW (window), button);
@ -107,7 +107,7 @@ do_tagged_entry (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -74,7 +74,7 @@ do_textmask (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -196,7 +196,7 @@ do_textscroll (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -60,7 +60,7 @@ do_textundo (GtkWidget *do_widget)
}
else
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
window = NULL;
}

View File

@ -523,7 +523,7 @@ do_textview (GtkWidget *do_widget)
}
else
{
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
window = NULL;
}

View File

@ -193,7 +193,7 @@ do_themes (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -37,7 +37,7 @@ do_theming_style_classes (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -62,7 +62,7 @@ do_transparent (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -436,7 +436,7 @@ do_tree_store (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -23,7 +23,7 @@ open_dialog_response_cb (GtkWidget *dialog,
g_object_unref (file);
}
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
}
static void
@ -88,7 +88,7 @@ do_video_player (GtkWidget *do_widget)
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
gtk_window_destroy (GTK_WINDOW (window));
return window;
}

View File

@ -375,7 +375,7 @@ open_response_cb (GtkWidget *dialog,
g_object_unref (file);
}
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
}
static void
@ -441,7 +441,7 @@ save_response_cb (GtkWidget *dialog,
"Saving failed");
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message_dialog),
"%s", error->message);
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (message_dialog);
g_error_free (error);
}
@ -450,7 +450,7 @@ save_response_cb (GtkWidget *dialog,
g_object_unref (file);
}
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
}
static void
@ -558,14 +558,14 @@ export_image_response_cb (GtkWidget *dialog,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"Exporting to image failed");
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_show (message_dialog);
}
g_object_unref (file);
}
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
g_object_unref (texture);
}

View File

@ -311,7 +311,7 @@ activate_quit (GSimpleAction *action,
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
gtk_window_destroy (GTK_WINDOW (win));
list = next;
}

View File

@ -247,7 +247,7 @@ shoot_one (WidgetInfo *info)
{
g_warning ("unable to save shot of %s", info->name);
}
gtk_widget_destroy (info->window);
gtk_window_destroy (GTK_WINDOW (info->window));
shot_id = 0;

View File

@ -16,7 +16,7 @@ action_activated (GSimpleAction *action,
g_action_get_name (G_ACTION (action)));
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_widget_destroy), dialog);
G_CALLBACK (gtk_window_destroy), dialog);
gtk_widget_show (dialog);
}

View File

@ -374,7 +374,7 @@ response (GtkDialog *dialog,
if (response_id == GTK_RESPONSE_CLOSE)
{
gtk_widget_destroy (GTK_WIDGET (dialog));
gtk_window_destroy (GTK_WINDOW (dialog));
return;
}

View File

@ -42,7 +42,7 @@ activate (GtkApplication *app,
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
button = gtk_button_new_with_label ("Quit");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window);
/* Place the Quit button in the grid cell (0, 1), and make it
* span 2 columns.

View File

@ -24,7 +24,7 @@ activate (GtkApplication *app,
button = gtk_button_new_with_label ("Hello World");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (window);

View File

@ -173,7 +173,7 @@ quit_app (GSimpleAction *action,
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
gtk_window_destroy (GTK_WINDOW (win));
list = next;
}
@ -382,7 +382,7 @@ configure_plugins (GSimpleAction *action,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), plugin_enabled ("black"));
g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), (char *) "black");
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));

View File

@ -101,7 +101,7 @@ quit_app (GSimpleAction *action,
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
gtk_window_destroy (GTK_WINDOW (win));
list = next;
}

View File

@ -249,13 +249,13 @@ other_application_dialog_response_cb (GtkDialog *dialog,
* 'Other application'
*/
gtk_combo_box_set_active (GTK_COMBO_BOX (self->combobox), self->last_active);
gtk_widget_destroy (GTK_WIDGET (dialog));
gtk_window_destroy (GTK_WINDOW (dialog));
return;
}
info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
gtk_window_destroy (GTK_WINDOW (dialog));
/* refresh the combobox to get the new application */
gtk_app_chooser_refresh (GTK_APP_CHOOSER (self));

View File

@ -400,7 +400,7 @@ show_error_dialog (const gchar *primary,
gtk_widget_show (message_dialog);
g_signal_connect (message_dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
G_CALLBACK (gtk_window_destroy), NULL);
}
static void

View File

@ -724,7 +724,7 @@ gtk_application_window_dispose (GObject *object)
if (priv->help_overlay)
{
gtk_widget_destroy (GTK_WIDGET (priv->help_overlay));
gtk_window_destroy (GTK_WINDOW (priv->help_overlay));
g_clear_object (&priv->help_overlay);
}
@ -922,7 +922,7 @@ gtk_application_window_set_help_overlay (GtkApplicationWindow *window,
g_return_if_fail (help_overlay == NULL || GTK_IS_SHORTCUTS_WINDOW (help_overlay));
if (priv->help_overlay)
gtk_widget_destroy (GTK_WIDGET (priv->help_overlay));
gtk_window_destroy (GTK_WINDOW (priv->help_overlay));
g_set_object (&priv->help_overlay, help_overlay);
if (!priv->help_overlay)

View File

@ -309,7 +309,7 @@ gtk_color_button_finalize (GObject *object)
GtkColorButton *button = GTK_COLOR_BUTTON (object);
if (button->cs_dialog != NULL)
gtk_widget_destroy (button->cs_dialog);
gtk_window_destroy (GTK_WINDOW (button->cs_dialog));
g_free (button->title);
gtk_widget_unparent (button->button);

View File

@ -118,7 +118,7 @@
*
* g_signal_connect_swapped (dialog,
* "response",
* G_CALLBACK (gtk_widget_destroy),
* G_CALLBACK (gtk_window_destroy),
* dialog);
*
* // Add the label, and show everything weve added
@ -1141,7 +1141,7 @@ run_destroy_handler (GtkDialog *dialog, gpointer data)
* // do_nothing_since_dialog_was_cancelled ();
* break;
* }
* gtk_widget_destroy (dialog);
* gtk_window_destroy (dialog);
* ]|
*
* Note that even though the recursive main loop gives the effect of a

View File

@ -1094,7 +1094,7 @@ gtk_file_chooser_button_dispose (GObject *object)
g_clear_object (&button->model);
}
g_clear_pointer (&button->dialog, gtk_widget_destroy);
g_clear_pointer ((GtkWindow **)&button->dialog, gtk_window_destroy);
if (button->native)
gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (button->native));

View File

@ -91,7 +91,7 @@
* open_file (file);
* }
*
* gtk_widget_destroy (dialog);
* gtk_window_destroy (dialog);
* ]|
*
* To use a dialog for saving, you can use this:
@ -124,7 +124,7 @@
* save_to_file (file);
* }
*
* gtk_widget_destroy (dialog);
* gtk_window_destroy (dialog);
* ]|
*
* ## Setting up a file chooser dialog ## {#gtkfilechooserdialog-setting-up}

View File

@ -493,7 +493,7 @@ gtk_file_chooser_native_finalize (GObject *object)
g_clear_pointer (&self->accept_label, g_free);
g_clear_pointer (&self->cancel_label, g_free);
gtk_widget_destroy (self->dialog);
gtk_window_destroy (GTK_WINDOW (self->dialog));
g_slist_free_full (self->custom_files, g_object_unref);
g_slist_free_full (self->choices, (GDestroyNotify)gtk_file_chooser_native_choice_free);

View File

@ -766,7 +766,7 @@ error_message (GtkFileChooserWidget *impl,
GTK_WINDOW (dialog));
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
}
@ -1261,7 +1261,7 @@ confirm_delete (GtkFileChooserWidget *impl,
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
return (response == GTK_RESPONSE_ACCEPT);
}
@ -5761,7 +5761,7 @@ confirm_dialog_should_accept_filename (GtkFileChooserWidget *impl,
* file list (will be restablished on next map()). Fixes data loss bug #2288 */
impl->browse_files_interaction_frozen = TRUE;
gtk_widget_destroy (dialog);
gtk_window_destroy (GTK_WINDOW (dialog));
return (response == GTK_RESPONSE_ACCEPT);
}

Some files were not shown because too many files have changed in this diff Show More