From fb8e52f0c957fa7880b9e1c57b15aa6a986def5e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 27 Nov 2022 23:03:14 -0500 Subject: [PATCH] gtk-demo: Stop using gtk_widget_show/hide --- demos/gtk-demo/application.c | 4 ++-- demos/gtk-demo/assistant.c | 4 +--- demos/gtk-demo/builder.c | 2 +- demos/gtk-demo/clipboard.c | 2 +- demos/gtk-demo/combobox.c | 2 +- demos/gtk-demo/constraints.c | 2 +- demos/gtk-demo/constraints_builder.c | 2 +- demos/gtk-demo/constraints_interactive.c | 2 +- demos/gtk-demo/constraints_vfl.c | 2 +- demos/gtk-demo/css_accordion.c | 2 +- demos/gtk-demo/css_basics.c | 2 +- demos/gtk-demo/css_blendmodes.c | 2 +- demos/gtk-demo/css_multiplebgs.c | 2 +- demos/gtk-demo/css_pixbufs.c | 2 +- demos/gtk-demo/css_shadows.c | 2 +- demos/gtk-demo/cursors.c | 2 +- demos/gtk-demo/dialog.c | 6 +++--- demos/gtk-demo/dnd.c | 2 +- demos/gtk-demo/drawingarea.c | 2 +- demos/gtk-demo/dropdown.c | 6 +++--- demos/gtk-demo/editable_cells.c | 2 +- demos/gtk-demo/entry_completion.c | 2 +- demos/gtk-demo/entry_undo.c | 2 +- demos/gtk-demo/errorstates.c | 8 ++++---- demos/gtk-demo/expander.c | 2 +- demos/gtk-demo/filtermodel.c | 2 +- demos/gtk-demo/fishbowl.c | 2 +- demos/gtk-demo/fixed.c | 2 +- demos/gtk-demo/flowbox.c | 2 +- demos/gtk-demo/font_features.c | 16 ++++++++-------- demos/gtk-demo/fontrendering.c | 2 +- demos/gtk-demo/frames.c | 2 +- demos/gtk-demo/gears.c | 6 +----- demos/gtk-demo/gestures.c | 2 +- demos/gtk-demo/glarea.c | 6 +----- demos/gtk-demo/gltransition.c | 8 ++++---- demos/gtk-demo/headerbar.c | 2 +- demos/gtk-demo/hypertext.c | 2 +- demos/gtk-demo/iconscroll.c | 2 +- demos/gtk-demo/iconview.c | 2 +- demos/gtk-demo/iconview_edit.c | 2 +- demos/gtk-demo/images.c | 2 +- demos/gtk-demo/infobar.c | 2 +- demos/gtk-demo/layoutmanager.c | 2 +- demos/gtk-demo/layoutmanager2.c | 2 +- demos/gtk-demo/links.c | 3 +-- demos/gtk-demo/list_store.c | 2 +- demos/gtk-demo/listbox.c | 3 +-- demos/gtk-demo/listbox_controls.c | 2 +- demos/gtk-demo/listview_applauncher.c | 2 +- demos/gtk-demo/listview_clocks.c | 2 +- demos/gtk-demo/listview_colors.c | 2 +- demos/gtk-demo/listview_filebrowser.c | 2 +- demos/gtk-demo/listview_minesweeper.c | 2 +- demos/gtk-demo/listview_settings.c | 2 +- demos/gtk-demo/listview_ucd.c | 2 +- demos/gtk-demo/listview_weather.c | 2 +- demos/gtk-demo/listview_words.c | 2 +- demos/gtk-demo/main.c | 1 - demos/gtk-demo/markup.c | 5 +---- demos/gtk-demo/menu.c | 2 +- demos/gtk-demo/overlay.c | 2 +- demos/gtk-demo/overlay_decorative.c | 2 +- demos/gtk-demo/pagesetup.c | 2 +- demos/gtk-demo/paint.c | 2 +- demos/gtk-demo/paintable.c | 2 +- demos/gtk-demo/paintable_animated.c | 2 +- demos/gtk-demo/paintable_emblem.c | 2 +- demos/gtk-demo/paintable_mediastream.c | 2 +- demos/gtk-demo/paintable_symbolic.c | 2 +- demos/gtk-demo/panes.c | 2 +- demos/gtk-demo/password_entry.c | 2 +- demos/gtk-demo/peg_solitaire.c | 2 +- demos/gtk-demo/pickers.c | 2 +- demos/gtk-demo/read_more.c | 2 +- demos/gtk-demo/revealer.c | 2 +- demos/gtk-demo/rotated_text.c | 2 +- demos/gtk-demo/scale.c | 2 +- demos/gtk-demo/search_entry.c | 4 +--- demos/gtk-demo/search_entry2.c | 2 +- demos/gtk-demo/shadertoy.c | 2 +- demos/gtk-demo/shortcut_triggers.c | 2 +- demos/gtk-demo/shortcuts.c | 3 +-- demos/gtk-demo/sidebar.c | 2 +- demos/gtk-demo/sizegroup.c | 2 +- demos/gtk-demo/sliding_puzzle.c | 2 +- demos/gtk-demo/spinbutton.c | 2 +- demos/gtk-demo/spinner.c | 2 +- demos/gtk-demo/stack.c | 2 +- demos/gtk-demo/tabs.c | 2 +- demos/gtk-demo/tagged_entry.c | 2 +- demos/gtk-demo/textmask.c | 2 +- demos/gtk-demo/textscroll.c | 2 +- demos/gtk-demo/textundo.c | 2 +- demos/gtk-demo/textview.c | 4 ++-- demos/gtk-demo/themes.c | 4 ++-- demos/gtk-demo/theming_style_classes.c | 2 +- demos/gtk-demo/transparent.c | 2 +- demos/gtk-demo/tree_store.c | 2 +- demos/gtk-demo/video_player.c | 2 +- 100 files changed, 119 insertions(+), 138 deletions(-) diff --git a/demos/gtk-demo/application.c b/demos/gtk-demo/application.c index 718bf9c5f5..4570d06452 100644 --- a/demos/gtk-demo/application.c +++ b/demos/gtk-demo/application.c @@ -57,7 +57,7 @@ show_action_infobar (GSimpleAction *action, text = g_strdup_printf ("You activated radio action: \"%s\".\n" "Current value: %s", name, value); gtk_label_set_text (GTK_LABEL (window->message), text); - gtk_widget_show (window->infobar); + gtk_widget_set_visible (window->infobar, TRUE); g_free (text); } @@ -295,7 +295,7 @@ static GActionEntry win_entries[] = { static void clicked_cb (GtkWidget *widget, DemoApplicationWindow *window) { - gtk_widget_hide (window->infobar); + gtk_widget_set_visible (window->infobar, FALSE); } static void diff --git a/demos/gtk-demo/assistant.c b/demos/gtk-demo/assistant.c index 238bb0524a..6c1561c4e4 100644 --- a/demos/gtk-demo/assistant.c +++ b/demos/gtk-demo/assistant.c @@ -140,7 +140,6 @@ create_page3 (GtkWidget *assistant) label = gtk_label_new ("This is a confirmation page, press 'Apply' to apply changes"); - gtk_widget_show (label); gtk_assistant_append_page (GTK_ASSISTANT (assistant), label); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_CONFIRM); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE); @@ -157,7 +156,6 @@ create_page4 (GtkWidget *assistant) gtk_widget_set_margin_start (progress_bar, 40); gtk_widget_set_margin_end (progress_bar, 40); - gtk_widget_show (progress_bar); gtk_assistant_append_page (GTK_ASSISTANT (assistant), progress_bar); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), progress_bar, GTK_ASSISTANT_PAGE_PROGRESS); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), progress_bar, "Applying changes"); @@ -199,7 +197,7 @@ do_assistant (GtkWidget *do_widget) } if (!gtk_widget_get_visible (assistant)) - gtk_widget_show (assistant); + gtk_widget_set_visible (assistant, TRUE); else gtk_window_destroy (GTK_WINDOW (assistant)); diff --git a/demos/gtk-demo/builder.c b/demos/gtk-demo/builder.c index 082632204a..54e777d8c3 100644 --- a/demos/gtk-demo/builder.c +++ b/demos/gtk-demo/builder.c @@ -168,7 +168,7 @@ do_builder (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c index fd103a676c..753ecb32d9 100644 --- a/demos/gtk-demo/clipboard.c +++ b/demos/gtk-demo/clipboard.c @@ -402,7 +402,7 @@ do_clipboard (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c index 1450e8055a..865ec406f6 100644 --- a/demos/gtk-demo/combobox.c +++ b/demos/gtk-demo/combobox.c @@ -449,7 +449,7 @@ do_combobox (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/constraints.c b/demos/gtk-demo/constraints.c index a295c91d44..53c58dd4da 100644 --- a/demos/gtk-demo/constraints.c +++ b/demos/gtk-demo/constraints.c @@ -277,7 +277,7 @@ do_constraints (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/constraints_builder.c b/demos/gtk-demo/constraints_builder.c index 5d8b6a9413..45320b4f7d 100644 --- a/demos/gtk-demo/constraints_builder.c +++ b/demos/gtk-demo/constraints_builder.c @@ -66,7 +66,7 @@ do_constraints_builder (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/constraints_interactive.c b/demos/gtk-demo/constraints_interactive.c index 90262552f6..68f91b079a 100644 --- a/demos/gtk-demo/constraints_interactive.c +++ b/demos/gtk-demo/constraints_interactive.c @@ -229,7 +229,7 @@ do_constraints_interactive (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/constraints_vfl.c b/demos/gtk-demo/constraints_vfl.c index 08016f0b48..9b8268ae1c 100644 --- a/demos/gtk-demo/constraints_vfl.c +++ b/demos/gtk-demo/constraints_vfl.c @@ -152,7 +152,7 @@ do_constraints_vfl (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/css_accordion.c b/demos/gtk-demo/css_accordion.c index 6d327a8aab..99871e67b0 100644 --- a/demos/gtk-demo/css_accordion.c +++ b/demos/gtk-demo/css_accordion.c @@ -68,7 +68,7 @@ do_css_accordion (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/css_basics.c b/demos/gtk-demo/css_basics.c index f3db37e46e..66e318ae78 100644 --- a/demos/gtk-demo/css_basics.c +++ b/demos/gtk-demo/css_basics.c @@ -115,7 +115,7 @@ do_css_basics (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/css_blendmodes.c b/demos/gtk-demo/css_blendmodes.c index 0543750d9c..81884c2234 100644 --- a/demos/gtk-demo/css_blendmodes.c +++ b/demos/gtk-demo/css_blendmodes.c @@ -139,7 +139,7 @@ do_css_blendmodes (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/css_multiplebgs.c b/demos/gtk-demo/css_multiplebgs.c index da625be09d..0909c383d6 100644 --- a/demos/gtk-demo/css_multiplebgs.c +++ b/demos/gtk-demo/css_multiplebgs.c @@ -155,7 +155,7 @@ do_css_multiplebgs (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/css_pixbufs.c b/demos/gtk-demo/css_pixbufs.c index d607f70100..df96c2cf22 100644 --- a/demos/gtk-demo/css_pixbufs.c +++ b/demos/gtk-demo/css_pixbufs.c @@ -124,7 +124,7 @@ do_css_pixbufs (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/css_shadows.c b/demos/gtk-demo/css_shadows.c index 6c73134594..39628d2801 100644 --- a/demos/gtk-demo/css_shadows.c +++ b/demos/gtk-demo/css_shadows.c @@ -142,7 +142,7 @@ do_css_shadows (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/cursors.c b/demos/gtk-demo/cursors.c index 31d935d813..209dfd9b58 100644 --- a/demos/gtk-demo/cursors.c +++ b/demos/gtk-demo/cursors.c @@ -33,7 +33,7 @@ do_cursors (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c index b5a709ad38..42f2977db7 100644 --- a/demos/gtk-demo/dialog.c +++ b/demos/gtk-demo/dialog.c @@ -29,7 +29,7 @@ message_dialog_clicked (GtkButton *button, gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), ngettext ("Has been shown once", "Has been shown %d times", i), i); g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL); - gtk_widget_show (dialog); + gtk_window_present (GTK_WINDOW (dialog)); i++; } @@ -116,7 +116,7 @@ interactive_dialog_clicked (GtkButton *button, data, (GClosureNotify) g_free, 0); - gtk_widget_show (dialog); + gtk_window_present (GTK_WINDOW (dialog)); } GtkWidget * @@ -186,7 +186,7 @@ do_dialog (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/dnd.c b/demos/gtk-demo/dnd.c index fbf28ec305..beba858832 100644 --- a/demos/gtk-demo/dnd.c +++ b/demos/gtk-demo/dnd.c @@ -802,7 +802,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c index 68d4aee9e8..d58c712347 100644 --- a/demos/gtk-demo/drawingarea.c +++ b/demos/gtk-demo/drawingarea.c @@ -372,7 +372,7 @@ do_drawingarea (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/dropdown.c b/demos/gtk-demo/dropdown.c index aea35f7bcb..a4d001f4f6 100644 --- a/demos/gtk-demo/dropdown.c +++ b/demos/gtk-demo/dropdown.c @@ -164,14 +164,14 @@ strings_bind_item (GtkSignalListItemFactory *factory, popup = gtk_widget_get_ancestor (title, GTK_TYPE_POPOVER); if (popup && gtk_widget_is_ancestor (popup, GTK_WIDGET (dropdown))) { - gtk_widget_show (checkmark); + gtk_widget_set_visible (checkmark, TRUE); g_signal_connect (dropdown, "notify::selected-item", G_CALLBACK (selected_item_changed), item); selected_item_changed (dropdown, NULL, item); } else { - gtk_widget_hide (checkmark); + gtk_widget_set_visible (checkmark, FALSE); } } @@ -563,7 +563,7 @@ do_dropdown (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/editable_cells.c b/demos/gtk-demo/editable_cells.c index 11e914bd6f..c2ca17b93c 100644 --- a/demos/gtk-demo/editable_cells.c +++ b/demos/gtk-demo/editable_cells.c @@ -409,7 +409,7 @@ do_editable_cells (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/entry_completion.c b/demos/gtk-demo/entry_completion.c index 979194d1c6..614571f0cf 100644 --- a/demos/gtk-demo/entry_completion.c +++ b/demos/gtk-demo/entry_completion.c @@ -115,7 +115,7 @@ do_entry_completion (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/entry_undo.c b/demos/gtk-demo/entry_undo.c index 37cbe7037b..48ee0e8b32 100644 --- a/demos/gtk-demo/entry_undo.c +++ b/demos/gtk-demo/entry_undo.c @@ -46,7 +46,7 @@ do_entry_undo (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/errorstates.c b/demos/gtk-demo/errorstates.c index 82ea73dbca..c3a9bbc041 100644 --- a/demos/gtk-demo/errorstates.c +++ b/demos/gtk-demo/errorstates.c @@ -42,12 +42,12 @@ mode_switch_state_set (GtkSwitch *sw, if (!state || (gtk_range_get_value (GTK_RANGE (scale)) > 50)) { - gtk_widget_hide (label); + gtk_widget_set_visible (label, FALSE); gtk_switch_set_state (sw, state); } else { - gtk_widget_show (label); + gtk_widget_set_visible (label, TRUE); } return TRUE; @@ -65,7 +65,7 @@ level_scale_value_changed (GtkRange *range, !gtk_switch_get_state (GTK_SWITCH (sw)) && (gtk_range_get_value (range) > 50)) { - gtk_widget_hide (label); + gtk_widget_set_visible (label, FALSE); gtk_switch_set_state (GTK_SWITCH (sw), TRUE); } else if (gtk_switch_get_state (GTK_SWITCH (sw)) && @@ -113,7 +113,7 @@ do_errorstates (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/expander.c b/demos/gtk-demo/expander.c index 7b3d792915..e350cb77c9 100644 --- a/demos/gtk-demo/expander.c +++ b/demos/gtk-demo/expander.c @@ -122,7 +122,7 @@ do_expander (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/filtermodel.c b/demos/gtk-demo/filtermodel.c index 78056eecc7..5f91b0e83f 100644 --- a/demos/gtk-demo/filtermodel.c +++ b/demos/gtk-demo/filtermodel.c @@ -199,7 +199,7 @@ do_filtermodel (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/fishbowl.c b/demos/gtk-demo/fishbowl.c index eb5a35309f..40e1bbb6c2 100644 --- a/demos/gtk-demo/fishbowl.c +++ b/demos/gtk-demo/fishbowl.c @@ -329,7 +329,7 @@ do_fishbowl (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/fixed.c b/demos/gtk-demo/fixed.c index f539e53e9b..44c0c2a54d 100644 --- a/demos/gtk-demo/fixed.c +++ b/demos/gtk-demo/fixed.c @@ -160,7 +160,7 @@ do_fixed (GtkWidget *do_widget) demo_window = create_demo_window (do_widget); if (!gtk_widget_get_visible (demo_window)) - gtk_widget_show (demo_window); + gtk_widget_set_visible (demo_window, TRUE); else gtk_window_destroy (GTK_WINDOW (demo_window)); diff --git a/demos/gtk-demo/flowbox.c b/demos/gtk-demo/flowbox.c index df7d6f3905..553d5b0014 100644 --- a/demos/gtk-demo/flowbox.c +++ b/demos/gtk-demo/flowbox.c @@ -742,7 +742,7 @@ do_flowbox (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/font_features.c b/demos/gtk-demo/font_features.c index 025b6d354a..f4b4113be3 100644 --- a/demos/gtk-demo/font_features.c +++ b/demos/gtk-demo/font_features.c @@ -973,8 +973,8 @@ update_features (void) for (l = demo->feature_items; l; l = l->next) { FeatureItem *item = l->data; - gtk_widget_show (item->feat); - gtk_widget_show (gtk_widget_get_parent (item->feat)); + gtk_widget_set_visible (item->feat, TRUE); + gtk_widget_set_visible (gtk_widget_get_parent (item->feat), TRUE); if (strcmp (item->name, "xxxx") == 0) gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE); } @@ -985,8 +985,8 @@ update_features (void) for (l = demo->feature_items; l; l = l->next) { FeatureItem *item = l->data; - gtk_widget_hide (item->feat); - gtk_widget_hide (gtk_widget_get_parent (item->feat)); + gtk_widget_set_visible (item->feat, FALSE); + gtk_widget_set_visible (gtk_widget_get_parent (item->feat), FALSE); if (strcmp (item->name, "xxxx") == 0) gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE); } @@ -1071,15 +1071,15 @@ update_features (void) if (item->tag == features[j]) { - gtk_widget_show (item->feat); - gtk_widget_show (gtk_widget_get_parent (item->feat)); + gtk_widget_set_visible (item->feat, TRUE); + gtk_widget_set_visible (gtk_widget_get_parent (item->feat), TRUE); if (GTK_IS_CHECK_BUTTON (item->feat)) { GtkWidget *def = GTK_WIDGET (g_object_get_data (G_OBJECT (item->feat), "default")); if (def) { - gtk_widget_show (def); - gtk_widget_show (gtk_widget_get_parent (def)); + gtk_widget_set_visible (def, TRUE); + gtk_widget_set_visible (gtk_widget_get_parent (def), TRUE); gtk_check_button_set_active (GTK_CHECK_BUTTON (def), TRUE); } else diff --git a/demos/gtk-demo/fontrendering.c b/demos/gtk-demo/fontrendering.c index 9ec15a5733..69a654d506 100644 --- a/demos/gtk-demo/fontrendering.c +++ b/demos/gtk-demo/fontrendering.c @@ -435,7 +435,7 @@ do_fontrendering (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/frames.c b/demos/gtk-demo/frames.c index 68f0a087e1..b2f29faff4 100644 --- a/demos/gtk-demo/frames.c +++ b/demos/gtk-demo/frames.c @@ -157,7 +157,7 @@ do_frames (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/gears.c b/demos/gtk-demo/gears.c index 54dfa5f0f3..e09eba5425 100644 --- a/demos/gtk-demo/gears.c +++ b/demos/gtk-demo/gears.c @@ -54,7 +54,6 @@ create_axis_slider (GtkGears *gears, label = gtk_label_new (text); gtk_box_append (GTK_BOX (box), label); - gtk_widget_show (label); adj = gtk_adjustment_new (gtk_gears_get_axis (gears, axis), 0.0, 360.0, 1.0, 12.0, 0.0); g_object_set_data (G_OBJECT (adj), "axis", GINT_TO_POINTER (axis)); @@ -65,9 +64,6 @@ create_axis_slider (GtkGears *gears, gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE); gtk_box_append (GTK_BOX (box), slider); gtk_widget_set_vexpand (slider, TRUE); - gtk_widget_show (slider); - - gtk_widget_show (box); return box; } @@ -129,7 +125,7 @@ do_gears (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/gestures.c b/demos/gtk-demo/gestures.c index d6682db9a4..0a33967723 100644 --- a/demos/gtk-demo/gestures.c +++ b/demos/gtk-demo/gestures.c @@ -208,7 +208,7 @@ do_gestures (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c index 428d9fdaae..430f44cde0 100644 --- a/demos/gtk-demo/glarea.c +++ b/demos/gtk-demo/glarea.c @@ -355,7 +355,6 @@ create_axis_slider (int axis) label = gtk_label_new (text); gtk_box_append (GTK_BOX (box), label); - gtk_widget_show (label); adj = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 12.0, 0.0); g_signal_connect (adj, "value-changed", @@ -364,9 +363,6 @@ create_axis_slider (int axis) slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj); gtk_box_append (GTK_BOX (box), slider); gtk_widget_set_hexpand (slider, TRUE); - gtk_widget_show (slider); - - gtk_widget_show (box); return box; } @@ -440,7 +436,7 @@ do_glarea (GtkWidget *do_widget) demo_window = create_glarea_window (do_widget); if (!gtk_widget_get_visible (demo_window)) - gtk_widget_show (demo_window); + gtk_widget_set_visible (demo_window, TRUE); else gtk_window_destroy (GTK_WINDOW (demo_window)); diff --git a/demos/gtk-demo/gltransition.c b/demos/gtk-demo/gltransition.c index 321a857147..e588a52924 100644 --- a/demos/gtk-demo/gltransition.c +++ b/demos/gtk-demo/gltransition.c @@ -33,7 +33,7 @@ static void text_changed (GtkTextBuffer *buffer, GtkWidget *button) { - gtk_widget_show (button); + gtk_widget_set_visible (button, TRUE); } static void @@ -58,7 +58,7 @@ apply_text (GtkWidget *button, g_object_unref (shader); g_bytes_unref (bytes); - gtk_widget_hide (button); + gtk_widget_set_visible (button, FALSE); } static void @@ -237,7 +237,7 @@ make_shader_stack (const char *name, gtk_widget_set_halign (button, GTK_ALIGN_CENTER); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); gtk_widget_add_css_class (button, "small"); - gtk_widget_hide (button); + gtk_widget_set_visible (button, FALSE); gtk_center_box_set_end_widget (GTK_CENTER_BOX (widget), button); gtk_box_append (GTK_BOX (vbox), widget); @@ -354,7 +354,7 @@ do_gltransition (GtkWidget *do_widget) demo_window = create_gltransition_window (do_widget); if (!gtk_widget_get_visible (demo_window)) - gtk_widget_show (demo_window); + gtk_widget_set_visible (demo_window, TRUE); else gtk_window_destroy (GTK_WINDOW (demo_window)); diff --git a/demos/gtk-demo/headerbar.c b/demos/gtk-demo/headerbar.c index d55559e0bf..185349ade6 100644 --- a/demos/gtk-demo/headerbar.c +++ b/demos/gtk-demo/headerbar.c @@ -50,7 +50,7 @@ do_headerbar (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/hypertext.c b/demos/gtk-demo/hypertext.c index a704784815..b7e3fd18c2 100644 --- a/demos/gtk-demo/hypertext.c +++ b/demos/gtk-demo/hypertext.c @@ -399,7 +399,7 @@ do_hypertext (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/iconscroll.c b/demos/gtk-demo/iconscroll.c index 8212818516..50f99be386 100644 --- a/demos/gtk-demo/iconscroll.c +++ b/demos/gtk-demo/iconscroll.c @@ -378,7 +378,7 @@ do_iconscroll (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/iconview.c b/demos/gtk-demo/iconview.c index 7b038cf474..f640221e7e 100644 --- a/demos/gtk-demo/iconview.c +++ b/demos/gtk-demo/iconview.c @@ -320,7 +320,7 @@ do_iconview (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/iconview_edit.c b/demos/gtk-demo/iconview_edit.c index 609b9b003b..4fd00b329b 100644 --- a/demos/gtk-demo/iconview_edit.c +++ b/demos/gtk-demo/iconview_edit.c @@ -151,7 +151,7 @@ do_iconview_edit (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c index 184ef3d162..af2ceb269c 100644 --- a/demos/gtk-demo/images.c +++ b/demos/gtk-demo/images.c @@ -422,7 +422,7 @@ do_images (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/infobar.c b/demos/gtk-demo/infobar.c index 9491588f8d..49cb0701da 100644 --- a/demos/gtk-demo/infobar.c +++ b/demos/gtk-demo/infobar.c @@ -140,7 +140,7 @@ do_infobar (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/layoutmanager.c b/demos/gtk-demo/layoutmanager.c index 6af308957d..81d76a6318 100644 --- a/demos/gtk-demo/layoutmanager.c +++ b/demos/gtk-demo/layoutmanager.c @@ -54,7 +54,7 @@ do_layoutmanager (GtkWidget *parent) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/layoutmanager2.c b/demos/gtk-demo/layoutmanager2.c index cc4b60d653..8d6da929db 100644 --- a/demos/gtk-demo/layoutmanager2.c +++ b/demos/gtk-demo/layoutmanager2.c @@ -190,7 +190,7 @@ do_layoutmanager2 (GtkWidget *parent) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/links.c b/demos/gtk-demo/links.c index 7efcb125d6..e7ae51d5f1 100644 --- a/demos/gtk-demo/links.c +++ b/demos/gtk-demo/links.c @@ -63,11 +63,10 @@ do_links (GtkWidget *do_widget) gtk_widget_set_margin_top (label, 20); gtk_widget_set_margin_bottom (label, 20); gtk_window_set_child (GTK_WINDOW (window), label); - gtk_widget_show (label); } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/list_store.c b/demos/gtk-demo/list_store.c index e71e78e4a3..b560586d51 100644 --- a/demos/gtk-demo/list_store.c +++ b/demos/gtk-demo/list_store.c @@ -300,7 +300,7 @@ do_list_store (GtkWidget *do_widget) if (!gtk_widget_get_visible (window)) { - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); if (timeout == 0) { /* FIXME this should use the animation-duration instead */ timeout = g_timeout_add (80, spinner_timeout, NULL); diff --git a/demos/gtk-demo/listbox.c b/demos/gtk-demo/listbox.c index 49bd2135ae..37bf647399 100644 --- a/demos/gtk-demo/listbox.c +++ b/demos/gtk-demo/listbox.c @@ -380,7 +380,6 @@ do_listbox (GtkWidget *do_widget) { message = gtk_message_new (lines[i]); row = gtk_message_row_new (message); - gtk_widget_show (GTK_WIDGET (row)); gtk_list_box_insert (GTK_LIST_BOX (listbox), GTK_WIDGET (row), -1); } @@ -389,7 +388,7 @@ do_listbox (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listbox_controls.c b/demos/gtk-demo/listbox_controls.c index b08507d880..17e03871e3 100644 --- a/demos/gtk-demo/listbox_controls.c +++ b/demos/gtk-demo/listbox_controls.c @@ -62,7 +62,7 @@ do_listbox_controls (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_applauncher.c b/demos/gtk-demo/listview_applauncher.c index 72adbedd96..e35b958731 100644 --- a/demos/gtk-demo/listview_applauncher.c +++ b/demos/gtk-demo/listview_applauncher.c @@ -191,7 +191,7 @@ do_listview_applauncher (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_clocks.c b/demos/gtk-demo/listview_clocks.c index 22a463823d..db208aef89 100644 --- a/demos/gtk-demo/listview_clocks.c +++ b/demos/gtk-demo/listview_clocks.c @@ -494,7 +494,7 @@ do_listview_clocks (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_colors.c b/demos/gtk-demo/listview_colors.c index c05807a1c1..45694430a6 100644 --- a/demos/gtk-demo/listview_colors.c +++ b/demos/gtk-demo/listview_colors.c @@ -1124,7 +1124,7 @@ do_listview_colors (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_filebrowser.c b/demos/gtk-demo/listview_filebrowser.c index e73ad41a0d..05f1d05e0c 100644 --- a/demos/gtk-demo/listview_filebrowser.c +++ b/demos/gtk-demo/listview_filebrowser.c @@ -275,7 +275,7 @@ do_listview_filebrowser (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_minesweeper.c b/demos/gtk-demo/listview_minesweeper.c index 662ba06553..236a92fe06 100644 --- a/demos/gtk-demo/listview_minesweeper.c +++ b/demos/gtk-demo/listview_minesweeper.c @@ -485,7 +485,7 @@ do_listview_minesweeper (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_settings.c b/demos/gtk-demo/listview_settings.c index b2c53230e0..fc484f3f45 100644 --- a/demos/gtk-demo/listview_settings.c +++ b/demos/gtk-demo/listview_settings.c @@ -430,7 +430,7 @@ do_listview_settings (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_ucd.c b/demos/gtk-demo/listview_ucd.c index 31b7fd22d4..b1bde50eac 100644 --- a/demos/gtk-demo/listview_ucd.c +++ b/demos/gtk-demo/listview_ucd.c @@ -383,7 +383,7 @@ do_listview_ucd (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_weather.c b/demos/gtk-demo/listview_weather.c index 488fd24ead..5feb2e144e 100644 --- a/demos/gtk-demo/listview_weather.c +++ b/demos/gtk-demo/listview_weather.c @@ -317,7 +317,7 @@ do_listview_weather (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/listview_words.c b/demos/gtk-demo/listview_words.c index a884ff8ef6..235af6a31e 100644 --- a/demos/gtk-demo/listview_words.c +++ b/demos/gtk-demo/listview_words.c @@ -249,7 +249,7 @@ do_listview_words (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index a7ea646244..430091fb00 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -463,7 +463,6 @@ add_data_tab (const char *demoname) widget = display_nothing (resource_name); label = gtk_label_new (label_string ? label_string : resources[i]); - gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label); g_object_set (gtk_notebook_get_page (GTK_NOTEBOOK (notebook), widget), "tab-expand", FALSE, diff --git a/demos/gtk-demo/markup.c b/demos/gtk-demo/markup.c index 487ffdd079..931831b76a 100644 --- a/demos/gtk-demo/markup.c +++ b/demos/gtk-demo/markup.c @@ -62,7 +62,6 @@ do_markup (GtkWidget *do_widget) g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); stack = gtk_stack_new (); - gtk_widget_show (stack); gtk_window_set_child (GTK_WINDOW (window), stack); show_source = gtk_check_button_new_with_label ("Source"); @@ -118,12 +117,10 @@ do_markup (GtkWidget *do_widget) gtk_text_buffer_end_irreversible_action (buffer); g_bytes_unref (bytes); - - gtk_widget_show (stack); } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/menu.c b/demos/gtk-demo/menu.c index d7db025910..b0a1ceb6a1 100644 --- a/demos/gtk-demo/menu.c +++ b/demos/gtk-demo/menu.c @@ -53,7 +53,7 @@ do_menu (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/overlay.c b/demos/gtk-demo/overlay.c index 51d09bcb24..5a103085f9 100644 --- a/demos/gtk-demo/overlay.c +++ b/demos/gtk-demo/overlay.c @@ -84,7 +84,7 @@ do_overlay (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/overlay_decorative.c b/demos/gtk-demo/overlay_decorative.c index 8306f52fb1..0fea2237eb 100644 --- a/demos/gtk-demo/overlay_decorative.c +++ b/demos/gtk-demo/overlay_decorative.c @@ -94,7 +94,7 @@ do_overlay_decorative (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/pagesetup.c b/demos/gtk-demo/pagesetup.c index 1f58652b6e..49062e74d3 100644 --- a/demos/gtk-demo/pagesetup.c +++ b/demos/gtk-demo/pagesetup.c @@ -28,7 +28,7 @@ do_pagesetup (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/paint.c b/demos/gtk-demo/paint.c index d60991f981..1696ca8e99 100644 --- a/demos/gtk-demo/paint.c +++ b/demos/gtk-demo/paint.c @@ -412,7 +412,7 @@ do_paint (GtkWidget *toplevel) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/paintable.c b/demos/gtk-demo/paintable.c index ef0480db62..9dcff247c6 100644 --- a/demos/gtk-demo/paintable.c +++ b/demos/gtk-demo/paintable.c @@ -175,7 +175,7 @@ do_paintable (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/paintable_animated.c b/demos/gtk-demo/paintable_animated.c index f60f287e8d..28a971426c 100644 --- a/demos/gtk-demo/paintable_animated.c +++ b/demos/gtk-demo/paintable_animated.c @@ -214,7 +214,7 @@ do_paintable_animated (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/paintable_emblem.c b/demos/gtk-demo/paintable_emblem.c index d220c1d6ea..2070ba22b1 100644 --- a/demos/gtk-demo/paintable_emblem.c +++ b/demos/gtk-demo/paintable_emblem.c @@ -177,7 +177,7 @@ do_paintable_emblem (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/paintable_mediastream.c b/demos/gtk-demo/paintable_mediastream.c index 0228c75803..5e492dae87 100644 --- a/demos/gtk-demo/paintable_mediastream.c +++ b/demos/gtk-demo/paintable_mediastream.c @@ -307,7 +307,7 @@ do_paintable_mediastream (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/paintable_symbolic.c b/demos/gtk-demo/paintable_symbolic.c index 8f31ca31ef..c67ce6048b 100644 --- a/demos/gtk-demo/paintable_symbolic.c +++ b/demos/gtk-demo/paintable_symbolic.c @@ -200,7 +200,7 @@ do_paintable_symbolic (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/panes.c b/demos/gtk-demo/panes.c index 00109ad3ce..8c1537bc90 100644 --- a/demos/gtk-demo/panes.c +++ b/demos/gtk-demo/panes.c @@ -82,7 +82,7 @@ do_panes (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/password_entry.c b/demos/gtk-demo/password_entry.c index 62ffb7897f..c463dde684 100644 --- a/demos/gtk-demo/password_entry.c +++ b/demos/gtk-demo/password_entry.c @@ -90,7 +90,7 @@ do_password_entry (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/peg_solitaire.c b/demos/gtk-demo/peg_solitaire.c index 12ed5a439d..b0a07c4ea5 100644 --- a/demos/gtk-demo/peg_solitaire.c +++ b/demos/gtk-demo/peg_solitaire.c @@ -487,7 +487,7 @@ do_peg_solitaire (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/pickers.c b/demos/gtk-demo/pickers.c index 430158049c..3a97fa7b37 100644 --- a/demos/gtk-demo/pickers.c +++ b/demos/gtk-demo/pickers.c @@ -140,7 +140,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/read_more.c b/demos/gtk-demo/read_more.c index 932b3f4b4e..d6afb76a07 100644 --- a/demos/gtk-demo/read_more.c +++ b/demos/gtk-demo/read_more.c @@ -231,7 +231,7 @@ do_read_more (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/revealer.c b/demos/gtk-demo/revealer.c index e4e94a8536..b6a9399c03 100644 --- a/demos/gtk-demo/revealer.c +++ b/demos/gtk-demo/revealer.c @@ -90,7 +90,7 @@ do_revealer (GtkWidget *do_widget) { count = 0; timeout = g_timeout_add (690, reveal_one, window); - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); } else { diff --git a/demos/gtk-demo/rotated_text.c b/demos/gtk-demo/rotated_text.c index 4f2c3f9513..ace2562330 100644 --- a/demos/gtk-demo/rotated_text.c +++ b/demos/gtk-demo/rotated_text.c @@ -210,7 +210,7 @@ do_rotated_text (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/scale.c b/demos/gtk-demo/scale.c index bb6b5119ed..53ba560848 100644 --- a/demos/gtk-demo/scale.c +++ b/demos/gtk-demo/scale.c @@ -27,7 +27,7 @@ do_scale (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/search_entry.c b/demos/gtk-demo/search_entry.c index ce92b85c01..5031817419 100644 --- a/demos/gtk-demo/search_entry.c +++ b/demos/gtk-demo/search_entry.c @@ -294,13 +294,11 @@ do_search_entry (GtkWidget *do_widget) g_signal_connect (find_button, "clicked", G_CALLBACK (start_search), entry); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), find_button, NULL); - gtk_widget_show (find_button); cancel_button = gtk_button_new_with_label ("Cancel"); g_signal_connect (cancel_button, "clicked", G_CALLBACK (stop_search), NULL); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), cancel_button, NULL); - gtk_widget_show (cancel_button); /* Set up the search icon */ gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE); @@ -314,7 +312,7 @@ do_search_entry (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else { g_clear_object (&actions); diff --git a/demos/gtk-demo/search_entry2.c b/demos/gtk-demo/search_entry2.c index 4e8315ba2c..e53beb1e5e 100644 --- a/demos/gtk-demo/search_entry2.c +++ b/demos/gtk-demo/search_entry2.c @@ -91,7 +91,7 @@ do_search_entry2 (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/shadertoy.c b/demos/gtk-demo/shadertoy.c index 2831baf51b..cc76e80dfe 100644 --- a/demos/gtk-demo/shadertoy.c +++ b/demos/gtk-demo/shadertoy.c @@ -194,7 +194,7 @@ do_shadertoy (GtkWidget *do_widget) demo_window = create_shadertoy_window (do_widget); if (!gtk_widget_get_visible (demo_window)) - gtk_widget_show (demo_window); + gtk_widget_set_visible (demo_window, TRUE); else gtk_window_destroy (GTK_WINDOW (demo_window)); diff --git a/demos/gtk-demo/shortcut_triggers.c b/demos/gtk-demo/shortcut_triggers.c index d5cb8627ab..33e07ea88b 100644 --- a/demos/gtk-demo/shortcut_triggers.c +++ b/demos/gtk-demo/shortcut_triggers.c @@ -87,7 +87,7 @@ do_shortcut_triggers (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/shortcuts.c b/demos/gtk-demo/shortcuts.c index 172ef61f43..9895df98dc 100644 --- a/demos/gtk-demo/shortcuts.c +++ b/demos/gtk-demo/shortcuts.c @@ -21,7 +21,6 @@ show_shortcuts (GtkWidget *window, overlay = GTK_WIDGET (gtk_builder_get_object (builder, id)); gtk_window_set_transient_for (GTK_WINDOW (overlay), GTK_WINDOW (window)); g_object_set (overlay, "view-name", view, NULL); - gtk_widget_show (overlay); g_object_unref (builder); } @@ -95,7 +94,7 @@ do_shortcuts (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/sidebar.c b/demos/gtk-demo/sidebar.c index 666129463e..8208ebac2f 100644 --- a/demos/gtk-demo/sidebar.c +++ b/demos/gtk-demo/sidebar.c @@ -74,7 +74,7 @@ do_sidebar (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/sizegroup.c b/demos/gtk-demo/sizegroup.c index e356de0e0d..acbe0ff5d3 100644 --- a/demos/gtk-demo/sizegroup.c +++ b/demos/gtk-demo/sizegroup.c @@ -140,7 +140,7 @@ do_sizegroup (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/sliding_puzzle.c b/demos/gtk-demo/sliding_puzzle.c index 0e4c08a00f..6389586c0d 100644 --- a/demos/gtk-demo/sliding_puzzle.c +++ b/demos/gtk-demo/sliding_puzzle.c @@ -515,7 +515,7 @@ do_sliding_puzzle (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/spinbutton.c b/demos/gtk-demo/spinbutton.c index 44f0cfe880..85d8c9c8ac 100644 --- a/demos/gtk-demo/spinbutton.c +++ b/demos/gtk-demo/spinbutton.c @@ -236,7 +236,7 @@ do_spinbutton (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/spinner.c b/demos/gtk-demo/spinner.c index 8cd6b76680..d278587ac9 100644 --- a/demos/gtk-demo/spinner.c +++ b/demos/gtk-demo/spinner.c @@ -91,7 +91,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/stack.c b/demos/gtk-demo/stack.c index 96c7503ffc..6f16e04eb0 100644 --- a/demos/gtk-demo/stack.c +++ b/demos/gtk-demo/stack.c @@ -27,7 +27,7 @@ do_stack (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/tabs.c b/demos/gtk-demo/tabs.c index b9db82f333..96c2300ac8 100644 --- a/demos/gtk-demo/tabs.c +++ b/demos/gtk-demo/tabs.c @@ -58,7 +58,7 @@ do_tabs (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/tagged_entry.c b/demos/gtk-demo/tagged_entry.c index 02c336a4c6..7b60088309 100644 --- a/demos/gtk-demo/tagged_entry.c +++ b/demos/gtk-demo/tagged_entry.c @@ -95,7 +95,7 @@ do_tagged_entry (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/textmask.c b/demos/gtk-demo/textmask.c index 60a81dc270..5369c2df65 100644 --- a/demos/gtk-demo/textmask.c +++ b/demos/gtk-demo/textmask.c @@ -72,7 +72,7 @@ do_textmask (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/textscroll.c b/demos/gtk-demo/textscroll.c index 8bb62a8406..7da926dfb5 100644 --- a/demos/gtk-demo/textscroll.c +++ b/demos/gtk-demo/textscroll.c @@ -195,7 +195,7 @@ do_textscroll (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/textundo.c b/demos/gtk-demo/textundo.c index f1fe41853e..dedbf38b53 100644 --- a/demos/gtk-demo/textundo.c +++ b/demos/gtk-demo/textundo.c @@ -66,7 +66,7 @@ do_textundo (GtkWidget *do_widget) if (!gtk_widget_get_visible (window)) { - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); } else { diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c index ad7da1b1da..287a4454d9 100644 --- a/demos/gtk-demo/textview.c +++ b/demos/gtk-demo/textview.c @@ -523,7 +523,7 @@ do_textview (GtkWidget *do_widget) if (!gtk_widget_get_visible (window)) { - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); } else { @@ -606,5 +606,5 @@ easter_egg_callback (GtkWidget *button, gtk_window_set_default_size (GTK_WINDOW (window), 300, 400); - gtk_widget_show (window); + gtk_window_present (GTK_WINDOW (window)); } diff --git a/demos/gtk-demo/themes.c b/demos/gtk-demo/themes.c index 8af63b463f..f7a2e5d1d8 100644 --- a/demos/gtk-demo/themes.c +++ b/demos/gtk-demo/themes.c @@ -88,7 +88,7 @@ warning_closed (GtkDialog *warning, GtkWidget *window; GtkWidget *button; - gtk_widget_hide (GTK_WIDGET (warning)); + gtk_widget_set_visible (GTK_WIDGET (warning), FALSE); window = gtk_widget_get_ancestor (GTK_WIDGET (data), GTK_TYPE_WINDOW); button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "button")); @@ -130,7 +130,7 @@ do_themes (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/theming_style_classes.c b/demos/gtk-demo/theming_style_classes.c index 011951df32..2d8772ca2d 100644 --- a/demos/gtk-demo/theming_style_classes.c +++ b/demos/gtk-demo/theming_style_classes.c @@ -35,7 +35,7 @@ do_theming_style_classes (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/transparent.c b/demos/gtk-demo/transparent.c index 7263feb718..10d9e81da0 100644 --- a/demos/gtk-demo/transparent.c +++ b/demos/gtk-demo/transparent.c @@ -61,7 +61,7 @@ do_transparent (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/tree_store.c b/demos/gtk-demo/tree_store.c index 0a7730d637..1968bb3aa2 100644 --- a/demos/gtk-demo/tree_store.c +++ b/demos/gtk-demo/tree_store.c @@ -436,7 +436,7 @@ do_tree_store (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window)); diff --git a/demos/gtk-demo/video_player.c b/demos/gtk-demo/video_player.c index f34c640419..b6909472a5 100644 --- a/demos/gtk-demo/video_player.c +++ b/demos/gtk-demo/video_player.c @@ -177,7 +177,7 @@ do_video_player (GtkWidget *do_widget) } if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); + gtk_widget_set_visible (window, TRUE); else gtk_window_destroy (GTK_WINDOW (window));