From 228b3fc622980ced8a30d7d5c5b7ad36b18e2fb9 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Mon, 11 May 2020 19:57:25 +0500 Subject: [PATCH] tests: Stop explicitly showing widgets --- tests/gdkgears.c | 20 --------------- tests/testaccel.c | 2 -- tests/testadjustsize.c | 5 ---- tests/testassistant.c | 27 +------------------- tests/testbox.c | 1 - tests/testcellarea.c | 14 ----------- tests/testdialog.c | 19 --------------- tests/testfilechooserbutton.c | 5 ---- tests/testflowbox.c | 28 --------------------- tests/testglarea.c | 8 ------ tests/testgrid.c | 2 -- tests/testgtk.c | 46 ----------------------------------- tests/testlist.c | 3 --- tests/testlist2.c | 1 - tests/testmenubutton.c | 4 --- tests/testscrolledwindow.c | 14 ----------- tests/testselectionmode.c | 3 --- tests/testtreeview.c | 4 +-- tests/testwindowsize.c | 2 -- 19 files changed, 2 insertions(+), 206 deletions(-) diff --git a/tests/gdkgears.c b/tests/gdkgears.c index 5c98eed4db..e40460c495 100644 --- a/tests/gdkgears.c +++ b/tests/gdkgears.c @@ -66,7 +66,6 @@ create_axis_slider (GtkGears *gears, label = gtk_label_new (text); gtk_container_add (GTK_CONTAINER (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)); @@ -77,9 +76,6 @@ create_axis_slider (GtkGears *gears, gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE); gtk_container_add (GTK_CONTAINER (box), slider); gtk_widget_set_vexpand (slider, TRUE); - gtk_widget_show (slider); - - gtk_widget_show (box); return box; } @@ -93,7 +89,6 @@ moar_gears (GtkButton *button, gpointer data) gears = gtk_gears_new (); gtk_widget_set_size_request (gears, 100, 100); gtk_container_add (container, gears); - gtk_widget_show (gears); } static void @@ -142,43 +137,35 @@ main (int argc, char *argv[]) gtk_widget_set_margin_bottom (overlay, 12); gtk_window_set_child (GTK_WINDOW (window), overlay); - gtk_widget_show (overlay); revealer = gtk_revealer_new (); gtk_widget_set_halign (revealer, GTK_ALIGN_END); gtk_widget_set_valign (revealer, GTK_ALIGN_START); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), revealer); - gtk_widget_show (revealer); frame = gtk_frame_new (NULL); gtk_widget_add_css_class (frame, "app-notification"); gtk_revealer_set_child (GTK_REVEALER (revealer), frame); - gtk_widget_show (frame); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE); gtk_box_set_spacing (GTK_BOX (hbox), 6); gtk_frame_set_child (GTK_FRAME (frame), hbox); - gtk_widget_show (hbox); label = gtk_label_new ("This is a transparent overlay widget!!!!\nAmazing, eh?"); gtk_container_add (GTK_CONTAINER (hbox), label); - gtk_widget_show (label); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE); gtk_box_set_spacing (GTK_BOX (box), 6); gtk_overlay_set_child (GTK_OVERLAY (overlay), box); - gtk_widget_show (box); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE); gtk_box_set_spacing (GTK_BOX (box), 6); gtk_container_add (GTK_CONTAINER (box), hbox); - gtk_widget_show (hbox); gears = gtk_gears_new (); gtk_widget_set_hexpand (gears, TRUE); gtk_widget_set_vexpand (gears, TRUE); gtk_container_add (GTK_CONTAINER (hbox), gears); - gtk_widget_show (gears); for (i = 0; i < GTK_GEARS_N_AXIS; i++) gtk_container_add (GTK_CONTAINER (hbox), create_axis_slider (GTK_GEARS (gears), i)); @@ -186,7 +173,6 @@ main (int argc, char *argv[]) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE); gtk_box_set_spacing (GTK_BOX (hbox), 6); gtk_container_add (GTK_CONTAINER (box), hbox); - gtk_widget_show (hbox); fps_label = gtk_label_new (""); gtk_widget_set_hexpand (fps_label, TRUE); @@ -229,33 +215,27 @@ main (int argc, char *argv[]) GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); gtk_container_add (GTK_CONTAINER (box), scrolled); - gtk_widget_show (scrolled); extra_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE); gtk_box_set_spacing (GTK_BOX (extra_hbox), 6); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), extra_hbox); - gtk_widget_show (extra_hbox); bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_set_spacing (GTK_BOX (bbox), 6); gtk_container_add (GTK_CONTAINER (box), bbox); - gtk_widget_show (bbox); button = gtk_button_new_with_label ("Moar gears!"); gtk_container_add (GTK_CONTAINER (bbox), button); g_signal_connect (button, "clicked", G_CALLBACK (moar_gears), extra_hbox); - gtk_widget_show (button); button = gtk_button_new_with_label ("Less gears!"); gtk_container_add (GTK_CONTAINER (bbox), button); g_signal_connect (button, "clicked", G_CALLBACK (less_gears), extra_hbox); - gtk_widget_show (button); button = gtk_button_new_with_label ("Quit"); gtk_widget_set_hexpand (button, TRUE); gtk_container_add (GTK_CONTAINER (bbox), button); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_widget_show (button); gtk_widget_show (window); diff --git a/tests/testaccel.c b/tests/testaccel.c index 5f126f3be4..270d8a1b16 100644 --- a/tests/testaccel.c +++ b/tests/testaccel.c @@ -73,7 +73,6 @@ key_test (void) sw = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_vexpand (sw, TRUE); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_widget_show (box); gtk_window_set_child (GTK_WINDOW (window), box); gtk_container_add (GTK_CONTAINER (box), sw); @@ -112,7 +111,6 @@ key_test (void) } entry = gtk_entry_new (); - gtk_widget_show (entry); gtk_container_add (GTK_CONTAINER (box), entry); return window; diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c index 2e3c251f16..d9a122042a 100644 --- a/tests/testadjustsize.c +++ b/tests/testadjustsize.c @@ -331,11 +331,9 @@ open_valigned_label_window (void) g_signal_connect (test_window, "destroy", G_CALLBACK (quit_cb), &done); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_widget_show (box); gtk_window_set_child (GTK_WINDOW (window), box); label = gtk_label_new ("Both labels expand"); - gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (box), label); label = gtk_label_new ("Some wrapping text with width-chars = 15 and max-width-chars = 35"); @@ -343,10 +341,7 @@ open_valigned_label_window (void) gtk_label_set_width_chars (GTK_LABEL (label), 15); gtk_label_set_max_width_chars (GTK_LABEL (label), 35); - gtk_widget_show (label); - frame = gtk_frame_new (NULL); - gtk_widget_show (frame); gtk_frame_set_child (GTK_FRAME (frame), label); gtk_widget_set_valign (frame, GTK_ALIGN_CENTER); diff --git a/tests/testassistant.c b/tests/testassistant.c index 2d010753d3..83cc9d5c44 100644 --- a/tests/testassistant.c +++ b/tests/testassistant.c @@ -164,13 +164,11 @@ create_simple_assistant (GtkWidget *widget) G_CALLBACK (prepare_callback), NULL); page = get_test_page ("Page 1"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 1"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Page 2"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 2"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_CONFIRM); @@ -208,12 +206,10 @@ create_anonymous_assistant (GtkWidget *widget) G_CALLBACK (prepare_callback), NULL); page = get_test_page ("Page 1"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Page 2"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_CONFIRM); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); @@ -263,7 +259,6 @@ create_generous_assistant (GtkWidget *widget) G_CALLBACK (prepare_callback), NULL); page = get_test_page ("Introduction"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Introduction"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_INTRO); @@ -275,14 +270,12 @@ create_generous_assistant (GtkWidget *widget) check = gtk_check_button_new_with_label ("Next page visible"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (visible_cb), next); - gtk_widget_show (check); + G_CALLBACK (visible_cb), next); gtk_container_add (GTK_CONTAINER (page), check); add_completion_test_page (assistant, "Even More Content", TRUE, TRUE); page = get_test_page ("Confirmation"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Confirmation"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_CONFIRM); @@ -298,7 +291,6 @@ create_generous_assistant (GtkWidget *widget) gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_PROGRESS); page = gtk_check_button_new_with_label ("Summary complete"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Summary"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_SUMMARY); @@ -391,19 +383,16 @@ create_nonlinear_assistant (GtkWidget *widget) gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Page 2A"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 2"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Page 2B"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 2"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Confirmation"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Confirmation"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_CONFIRM); @@ -475,32 +464,27 @@ create_looping_assistant (GtkWidget *widget) assistant, NULL); page = get_test_page ("Introduction"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Introduction"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Content"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Content"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("More content"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "More content"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = gtk_check_button_new_with_label ("Loop?"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Loop?"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Confirmation"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Confirmation"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_CONFIRM); @@ -540,7 +524,6 @@ create_full_featured_assistant (GtkWidget *widget) button = gtk_button_new_with_label ("_Stop"); gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); - gtk_widget_show (button); gtk_assistant_add_action_widget (GTK_ASSISTANT (assistant), button); g_signal_connect (button, "clicked", G_CALLBACK (toggle_invisible), assistant); @@ -555,7 +538,6 @@ create_full_featured_assistant (GtkWidget *widget) G_CALLBACK (prepare_callback), NULL); page = get_test_page ("Page 1"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 1"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); @@ -566,13 +548,11 @@ create_full_featured_assistant (GtkWidget *widget) gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = gtk_file_chooser_widget_new (GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Filechooser"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Page 3"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 3"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_CONFIRM); @@ -603,7 +583,6 @@ flip_pages (GtkButton *button, GtkAssistant *assistant) gtk_assistant_remove_page (assistant, 1); gtk_assistant_insert_page (assistant, page, 2); - gtk_widget_show (page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, title); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); @@ -626,7 +605,6 @@ create_page_flipping_assistant (GtkWidget *widget) button = gtk_button_new_with_label ("_Flip"); gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); - gtk_widget_show (button); gtk_assistant_add_action_widget (GTK_ASSISTANT (assistant), button); g_signal_connect (button, "clicked", G_CALLBACK (flip_pages), assistant); @@ -641,7 +619,6 @@ create_page_flipping_assistant (GtkWidget *widget) G_CALLBACK (prepare_callback), NULL); page = get_test_page ("Page 1"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 1"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); @@ -654,13 +631,11 @@ create_page_flipping_assistant (GtkWidget *widget) gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Page 3"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 3"); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = get_test_page ("Summary"); - gtk_widget_show (page); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Summary"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_SUMMARY); diff --git a/tests/testbox.c b/tests/testbox.c index 1d91d6714d..62e62f3d47 100644 --- a/tests/testbox.c +++ b/tests/testbox.c @@ -110,7 +110,6 @@ main (int argc, char *argv[]) gtk_widget_set_margin_top (check, 10); gtk_widget_set_margin_bottom (check, 10); gtk_widget_set_halign (check, GTK_ALIGN_CENTER); - gtk_widget_show (check); gtk_container_add (GTK_CONTAINER (vbox), check); b = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); diff --git a/tests/testcellarea.c b/tests/testcellarea.c index 1726b15807..78c3e817ce 100644 --- a/tests/testcellarea.c +++ b/tests/testcellarea.c @@ -86,7 +86,6 @@ simple_iconview (void) GtkCellRenderer *renderer; iconview = gtk_icon_view_new (); - gtk_widget_show (iconview); model = simple_list_model (); @@ -205,7 +204,6 @@ simple_cell_area (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "changed", @@ -213,7 +211,6 @@ simple_cell_area (void) widget = gtk_check_button_new_with_label ("Align 2nd Cell"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "toggled", @@ -221,7 +218,6 @@ simple_cell_area (void) widget = gtk_check_button_new_with_label ("Align 3rd Cell"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "toggled", @@ -230,7 +226,6 @@ simple_cell_area (void) widget = gtk_check_button_new_with_label ("Expand 1st Cell"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "toggled", @@ -238,7 +233,6 @@ simple_cell_area (void) widget = gtk_check_button_new_with_label ("Expand 2nd Cell"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "toggled", @@ -246,7 +240,6 @@ simple_cell_area (void) widget = gtk_check_button_new_with_label ("Expand 3rd Cell"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "toggled", @@ -347,7 +340,6 @@ focus_iconview (gboolean color_bg, GtkCellRenderer **focus, GtkCellRenderer **si GtkCellRenderer *renderer, *toggle; iconview = gtk_icon_view_new (); - gtk_widget_show (iconview); model = focus_list_model (); @@ -425,7 +417,6 @@ focus_cell_area (void) window = gtk_window_new (); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); - gtk_widget_show (hbox); gtk_window_set_title (GTK_WINDOW (window), "Focus and editable cells"); @@ -448,7 +439,6 @@ focus_cell_area (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "changed", @@ -456,7 +446,6 @@ focus_cell_area (void) widget = gtk_check_button_new_with_label ("Focus Sibling"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "toggled", @@ -515,8 +504,6 @@ background_area (void) window = gtk_window_new (); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4); - gtk_widget_show (hbox); - gtk_widget_show (main_vbox); gtk_window_set_child (GTK_WINDOW (window), main_vbox); gtk_window_set_title (GTK_WINDOW (window), "Background Area"); @@ -549,7 +536,6 @@ background_area (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (vbox), widget); g_signal_connect (G_OBJECT (widget), "changed", diff --git a/tests/testdialog.c b/tests/testdialog.c index ec467c4a60..14d35a261f 100644 --- a/tests/testdialog.c +++ b/tests/testdialog.c @@ -97,7 +97,6 @@ add_content (GtkWidget *dialog) gtk_widget_set_margin_bottom (label, 50); gtk_widget_set_hexpand (label, TRUE); gtk_widget_set_vexpand (label, TRUE); - gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), label); } @@ -331,97 +330,79 @@ main (int argc, char *argv[]) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_widget_set_halign (vbox, GTK_ALIGN_FILL); gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER); - gtk_widget_show (vbox); gtk_window_set_child (GTK_WINDOW (window), vbox); box = gtk_flow_box_new (); gtk_flow_box_set_selection_mode (GTK_FLOW_BOX (box), GTK_SELECTION_NONE); gtk_widget_set_hexpand (box, TRUE); - gtk_widget_show (box); gtk_container_add (GTK_CONTAINER (vbox), box); button = gtk_button_new_with_label ("Message dialog"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_message_dialog1), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Message with icon"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_message_dialog1a), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Confirmation dialog"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_message_dialog2), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Builtin"); button = gtk_button_new_with_label ("Builtin"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_color_chooser), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Generic Builtin"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_color_chooser_generic), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Simple"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("With Header"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_with_header), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("With Buttons"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_with_buttons), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Header & Buttons"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_with_header_buttons), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Header & Buttons & Builder"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_with_header_buttons2), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Template"); button = gtk_button_new_with_label ("Template"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_from_template), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Template With Header"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_from_template_with_header), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new_with_label ("Flexible Template"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_flex_template), window); - gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_check_button_new_with_label ("Dialogs have headers"); g_object_bind_property (gtk_settings_get_default (), "gtk-dialogs-use-header", button, "active", G_BINDING_BIDIRECTIONAL|G_BINDING_SYNC_CREATE); - gtk_widget_show (button); gtk_widget_set_halign (button, GTK_ALIGN_CENTER); gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_spinner_new (); gtk_spinner_start (GTK_SPINNER (button)); - gtk_widget_show (button); gtk_widget_set_halign (button, GTK_ALIGN_CENTER); gtk_container_add (GTK_CONTAINER (vbox), button); - gtk_widget_show (window); while (TRUE) g_main_context_iteration (NULL, TRUE); diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c index 196cebf764..8015a3e6e6 100644 --- a/tests/testfilechooserbutton.c +++ b/tests/testfilechooserbutton.c @@ -132,31 +132,26 @@ tests_button_clicked_cb (GtkButton *real_button, box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tests), box); - gtk_widget_show (box); button = gtk_button_new_with_label ("Print Selected Path"); g_signal_connect (button, "clicked", G_CALLBACK (print_selected_path_clicked_cb), user_data); gtk_container_add (GTK_CONTAINER (box), button); - gtk_widget_show (button); button = gtk_button_new_with_label ("Add $PWD's Parent as Shortcut"); g_signal_connect (button, "clicked", G_CALLBACK (add_pwds_parent_as_shortcut_clicked_cb), user_data); gtk_container_add (GTK_CONTAINER (box), button); - gtk_widget_show (button); button = gtk_button_new_with_label ("Remove $PWD's Parent as Shortcut"); g_signal_connect (button, "clicked", G_CALLBACK (del_pwds_parent_as_shortcut_clicked_cb), user_data); gtk_container_add (GTK_CONTAINER (box), button); - gtk_widget_show (button); button = gtk_button_new_with_label ("Unselect all"); g_signal_connect (button, "clicked", G_CALLBACK (unselect_all_clicked_cb), user_data); gtk_container_add (GTK_CONTAINER (box), button); - gtk_widget_show (button); g_object_set_data (user_data, "tests-dialog", tests); } diff --git a/tests/testflowbox.c b/tests/testflowbox.c index f44cbed2d9..e8b499bf6e 100644 --- a/tests/testflowbox.c +++ b/tests/testflowbox.c @@ -48,8 +48,6 @@ populate_flowbox_simple (GtkFlowBox *flowbox) widget = gtk_label_new (text); frame = gtk_frame_new (NULL); - gtk_widget_show (widget); - gtk_widget_show (frame); gtk_frame_set_child (GTK_FRAME (frame), widget); @@ -117,7 +115,6 @@ populate_flowbox_buttons (GtkFlowBox *flowbox) for (i = 0; i < 50; i++) { widget = gtk_button_new_with_label ("Button"); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (flowbox), widget); widget = gtk_widget_get_parent (widget); gtk_widget_set_can_focus (widget, FALSE); @@ -143,8 +140,6 @@ populate_flowbox_wrappy (GtkFlowBox *flowbox) { widget = gtk_label_new (strings[i]); frame = gtk_frame_new (NULL); - gtk_widget_show (widget); - gtk_widget_show (frame); gtk_frame_set_child (GTK_FRAME (frame), widget); @@ -384,8 +379,6 @@ create_window (void) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); - gtk_widget_show (vbox); - gtk_widget_show (hbox); gtk_window_set_child (GTK_WINDOW (window), hbox); gtk_container_add (GTK_CONTAINER (hbox), vbox); @@ -394,7 +387,6 @@ create_window (void) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_widget_show (swindow); gtk_container_add (GTK_CONTAINER (hbox), swindow); flowbox = gtk_flow_box_new (); @@ -406,7 +398,6 @@ create_window (void) gtk_flow_box_set_row_spacing (GTK_FLOW_BOX (flowbox), INITIAL_RSPACING); gtk_flow_box_set_min_children_per_line (GTK_FLOW_BOX (flowbox), INITIAL_MINIMUM_LENGTH); gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (flowbox), INITIAL_MAXIMUM_LENGTH); - gtk_widget_show (flowbox); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), flowbox); gtk_flow_box_set_hadjustment (GTK_FLOW_BOX (flowbox), @@ -421,14 +412,11 @@ create_window (void) expander = gtk_expander_new ("Flow Box controls"); gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE); flowbox_cntl = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - gtk_widget_show (flowbox_cntl); - gtk_widget_show (expander); gtk_container_add (GTK_CONTAINER (expander), flowbox_cntl); gtk_container_add (GTK_CONTAINER (vbox), expander); widget = gtk_check_button_new_with_label ("Homogeneous"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set whether the items should be displayed at the same size"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -441,7 +429,6 @@ create_window (void) g_object_bind_property (widget, "active", flowbox, "activate-on-single-click", G_BINDING_SYNC_CREATE); - gtk_widget_show (widget); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); /* Add alignment controls */ @@ -451,7 +438,6 @@ create_window (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "End"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Center"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), INITIAL_HALIGN); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the horizontal alignment policy"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -465,7 +451,6 @@ create_window (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "End"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Center"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), INITIAL_VALIGN); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the vertical alignment policy"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -478,7 +463,6 @@ create_window (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the flowbox orientation"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -493,7 +477,6 @@ create_window (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Browse"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Multiple"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the selection mode"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -504,7 +487,6 @@ create_window (void) /* Add minimum line length in items control */ widget = gtk_spin_button_new_with_range (1, 10, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_MINIMUM_LENGTH); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the minimum amount of items per line before wrapping"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -517,7 +499,6 @@ create_window (void) /* Add natural line length in items control */ widget = gtk_spin_button_new_with_range (1, 10, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_MAXIMUM_LENGTH); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the natural amount of items per line "); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -529,14 +510,12 @@ create_window (void) /* Add horizontal/vertical spacing controls */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); - gtk_widget_show (hbox); widget = gtk_label_new ("H Spacing"); gtk_container_add (GTK_CONTAINER (hbox), widget); widget = gtk_spin_button_new_with_range (0, 30, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_CSPACING); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the horizontal spacing between children"); gtk_container_add (GTK_CONTAINER (hbox), widget); @@ -549,14 +528,12 @@ create_window (void) gtk_container_add (GTK_CONTAINER (flowbox_cntl), hbox); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); - gtk_widget_show (hbox); widget = gtk_label_new ("V Spacing"); gtk_container_add (GTK_CONTAINER (hbox), widget); widget = gtk_spin_button_new_with_range (0, 30, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_RSPACING); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the vertical spacing between children"); gtk_container_add (GTK_CONTAINER (hbox), widget); @@ -572,7 +549,6 @@ create_window (void) widget = gtk_check_button_new_with_label ("Filter"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set whether some items should be filtered out"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -582,7 +558,6 @@ create_window (void) widget = gtk_check_button_new_with_label ("Sort"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set whether items should be sorted"); gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); @@ -595,8 +570,6 @@ create_window (void) expander = gtk_expander_new ("Test item controls"); gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE); items_cntl = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - gtk_widget_show (items_cntl); - gtk_widget_show (expander); gtk_container_add (GTK_CONTAINER (expander), items_cntl); gtk_container_add (GTK_CONTAINER (vbox), expander); @@ -608,7 +581,6 @@ create_window (void) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Images"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Buttons"); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the item set to use"); gtk_container_add (GTK_CONTAINER (items_cntl), widget); diff --git a/tests/testglarea.c b/tests/testglarea.c index df009dc16d..3fa0bcbf37 100644 --- a/tests/testglarea.c +++ b/tests/testglarea.c @@ -375,7 +375,6 @@ create_axis_slider (int axis) label = gtk_label_new (text); gtk_container_add (GTK_CONTAINER (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", @@ -384,9 +383,6 @@ create_axis_slider (int axis) slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj); gtk_container_add (GTK_CONTAINER (box), slider); gtk_widget_set_hexpand (slider, TRUE); - gtk_widget_show (slider); - - gtk_widget_show (box); return box; } @@ -427,7 +423,6 @@ main (int argc, char *argv[]) gtk_widget_set_margin_bottom (box, 12); gtk_box_set_spacing (GTK_BOX (box), 6); gtk_window_set_child (GTK_WINDOW (window), box); - gtk_widget_show (box); gl_area = gtk_gl_area_new (); gtk_widget_set_hexpand (gl_area, TRUE); @@ -436,12 +431,10 @@ main (int argc, char *argv[]) g_signal_connect (gl_area, "realize", G_CALLBACK (realize), NULL); g_signal_connect (gl_area, "unrealize", G_CALLBACK (unrealize), NULL); g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); - gtk_widget_show (gl_area); controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE); gtk_container_add (GTK_CONTAINER (box), controls); gtk_widget_set_hexpand (controls, TRUE); - gtk_widget_show (controls); for (i = 0; i < N_AXIS; i++) gtk_container_add (GTK_CONTAINER (controls), create_axis_slider (i)); @@ -450,7 +443,6 @@ main (int argc, char *argv[]) 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); - gtk_widget_show (button); gtk_widget_show (window); diff --git a/tests/testgrid.c b/tests/testgrid.c index ba007a89b8..36f73650b4 100644 --- a/tests/testgrid.c +++ b/tests/testgrid.c @@ -335,8 +335,6 @@ insert_cb (GtkButton *button, GtkWidget *window) gtk_grid_insert_next_to (g4, child, GTK_POS_RIGHT); gtk_grid_attach (g4, test_widget ("(1, 0)", "red"), 1, 0, 1, 1); gtk_grid_attach (g4, test_widget ("(1, 2)", "red"), 1, 2, 1, 1); - - gtk_widget_show (GTK_WIDGET (g)); } gtk_button_set_label (button, inserted ? "Insert" : "Remove"); diff --git a/tests/testgtk.c b/tests/testgtk.c index 48631a457f..0d2b9b3a91 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -836,8 +836,6 @@ create_sensitivity_control (GtkWidget *widget) "toggled", G_CALLBACK (sensitivity_toggled), widget); - - gtk_widget_show (button); return button; } @@ -889,8 +887,6 @@ create_selectable_control (GtkWidget *widget) "toggled", G_CALLBACK (selectable_toggled), widget); - - gtk_widget_show (button); return button; } @@ -1525,7 +1521,6 @@ add_placeholder_clicked_cb (GtkButton *button, GtkWidget *label; label = gtk_label_new ("You filtered everything!!!"); - gtk_widget_show (label); gtk_list_box_set_placeholder (GTK_LIST_BOX (list), label); } @@ -1579,7 +1574,6 @@ create_listbox (GtkWidget *widget) { gint value = g_random_int_range (0, 10000); label = gtk_label_new (g_strdup_printf ("Value %u", value)); - gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (list), label); g_object_set_data (G_OBJECT (gtk_widget_get_parent (label)), "value", GINT_TO_POINTER (value)); } @@ -2005,14 +1999,12 @@ create_scrolled_windows (GtkWidget *widget) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (content_area), scrolled_window); - gtk_widget_show (scrolled_window); grid = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (grid), 10); gtk_grid_set_column_spacing (GTK_GRID (grid), 10); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), grid); gtk_viewport_set_scroll_to_focus (GTK_VIEWPORT (gtk_widget_get_parent (grid)), TRUE); - gtk_widget_show (grid); for (i = 0; i < 20; i++) for (j = 0; j < 20; j++) @@ -2020,7 +2012,6 @@ create_scrolled_windows (GtkWidget *widget) sprintf (buffer, "button (%d,%d)\n", i, j); button = gtk_toggle_button_new_with_label (buffer); gtk_grid_attach (GTK_GRID (grid), button, i, j, 1, 1); - gtk_widget_show (button); } gtk_dialog_add_button (GTK_DIALOG (window), @@ -3192,7 +3183,6 @@ create_cursors (GtkWidget *widget) gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); g_signal_connect (gesture, "pressed", G_CALLBACK (cursor_pressed_cb), entry); gtk_widget_add_controller (darea, GTK_EVENT_CONTROLLER (gesture)); - gtk_widget_show (darea); g_signal_connect (entry, "changed", G_CALLBACK (set_cursor_from_name), darea); @@ -3488,7 +3478,6 @@ dialog_response_cb (GtkWidget *widget, gint response, gpointer unused) gtk_widget_set_margin_bottom (label, 10); gtk_container_add (GTK_CONTAINER (content_area), label); - gtk_widget_show (label); } g_list_free (children); @@ -3705,12 +3694,10 @@ create_range_controls (GtkWidget *widget) box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_window_set_child (GTK_WINDOW (window), box1); - gtk_widget_show (box1); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); gtk_container_add (GTK_CONTAINER (box1), box2); - gtk_widget_show (box2); adjustment = gtk_adjustment_new (0.0, 0.0, 101.0, 0.1, 1.0, 1.0); @@ -3720,11 +3707,9 @@ create_range_controls (GtkWidget *widget) gtk_scale_set_digits (GTK_SCALE (scale), 1); gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); gtk_container_add (GTK_CONTAINER (box2), scale); - gtk_widget_show (scale); scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (adjustment)); gtk_container_add (GTK_CONTAINER (box2), scrollbar); - gtk_widget_show (scrollbar); scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (adjustment)); gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); @@ -3732,7 +3717,6 @@ create_range_controls (GtkWidget *widget) (GtkScaleFormatValueFunc) reformat_value, NULL, NULL); gtk_container_add (GTK_CONTAINER (box2), scale); - gtk_widget_show (scale); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); @@ -3741,7 +3725,6 @@ create_range_controls (GtkWidget *widget) gtk_scale_set_digits (GTK_SCALE (scale), 2); gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); gtk_container_add (GTK_CONTAINER (hbox), scale); - gtk_widget_show (scale); scale = gtk_scale_new (GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT (adjustment)); gtk_widget_set_size_request (scale, -1, 200); @@ -3749,7 +3732,6 @@ create_range_controls (GtkWidget *widget) gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); gtk_range_set_inverted (GTK_RANGE (scale), TRUE); gtk_container_add (GTK_CONTAINER (hbox), scale); - gtk_widget_show (scale); scale = gtk_scale_new (GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT (adjustment)); gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); @@ -3757,20 +3739,16 @@ create_range_controls (GtkWidget *widget) (GtkScaleFormatValueFunc) reformat_value, NULL, NULL); gtk_container_add (GTK_CONTAINER (hbox), scale); - gtk_widget_show (scale); gtk_container_add (GTK_CONTAINER (box2), hbox); - gtk_widget_show (hbox); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_container_add (GTK_CONTAINER (box1), separator); - gtk_widget_show (separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); gtk_container_add (GTK_CONTAINER (box1), box2); - gtk_widget_show (box2); button = gtk_button_new_with_label ("close"); @@ -3779,7 +3757,6 @@ create_range_controls (GtkWidget *widget) window); gtk_container_add (GTK_CONTAINER (box2), button); gtk_window_set_default_widget (GTK_WINDOW (window), button); - gtk_widget_show (button); } if (!gtk_widget_get_visible (window)) @@ -3934,8 +3911,6 @@ create_pages (GtkNotebook *notebook, gint start, gint end) G_CALLBACK (gtk_widget_hide), child); - gtk_widget_show (child); - label_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); pixwid = gtk_image_new_from_pixbuf (book_closed); g_object_set_data (G_OBJECT (child), "tab_pixmap", pixwid); @@ -3947,7 +3922,6 @@ create_pages (GtkNotebook *notebook, gint start, gint end) gtk_widget_set_margin_top (pixwid, 1); label = gtk_label_new_with_mnemonic (accel_buffer); gtk_container_add (GTK_CONTAINER (label_box), label); - gtk_widget_show (label_box); menu_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); @@ -3961,7 +3935,6 @@ create_pages (GtkNotebook *notebook, gint start, gint end) gtk_widget_set_margin_top (pixwid, 1); label = gtk_label_new (buffer); gtk_container_add (GTK_CONTAINER (menu_box), label); - gtk_widget_show (menu_box); gtk_notebook_append_page_menu (notebook, child, label_box, menu_box); } @@ -4318,8 +4291,6 @@ create_panes (GtkWidget *widget) "Vertical", "Top", "Bottom")); - - gtk_widget_show (vbox); } if (!gtk_widget_get_visible (window)) @@ -4736,22 +4707,18 @@ create_wmhints (GtkWidget *widget) box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_window_set_child (GTK_WINDOW (window), box1); - gtk_widget_show (box1); label = gtk_label_new ("Try iconizing me!"); gtk_widget_set_size_request (label, 150, 50); gtk_container_add (GTK_CONTAINER (box1), label); - gtk_widget_show (label); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_container_add (GTK_CONTAINER (box1), separator); - gtk_widget_show (separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); gtk_container_add (GTK_CONTAINER (box1), box2); - gtk_widget_show (box2); button = gtk_button_new_with_label ("close"); @@ -4762,7 +4729,6 @@ create_wmhints (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (box2), button); gtk_window_set_default_widget (GTK_WINDOW (window), button); - gtk_widget_show (button); } if (!gtk_widget_get_visible (window)) @@ -4879,8 +4845,6 @@ tracking_label (GtkWidget *window) G_CONNECT_SWAPPED); gtk_container_add (GTK_CONTAINER (hbox), button); - gtk_widget_show (hbox); - return hbox; } @@ -4940,8 +4904,6 @@ get_state_controls (GtkWidget *window) G_CONNECT_SWAPPED); gtk_container_add (GTK_CONTAINER (vbox), button); - gtk_widget_show (vbox); - return vbox; } @@ -5009,7 +4971,6 @@ create_surface_states (GtkWidget *widget) gtk_widget_show (iconified); gtk_widget_show (normal); - gtk_widget_show (box1); } if (!gtk_widget_get_visible (window)) @@ -5212,8 +5173,6 @@ window_controls (GtkWidget *window) G_CONNECT_SWAPPED); gtk_container_add (GTK_CONTAINER (vbox), button); - gtk_widget_show (vbox); - return control_window; } @@ -5627,7 +5586,6 @@ create_timeout_test (GtkWidget *widget) gtk_widget_set_margin_top (label, 10); gtk_widget_set_margin_bottom (label, 10); gtk_container_add (GTK_CONTAINER (content_area), label); - gtk_widget_show (label); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", @@ -5635,21 +5593,18 @@ create_timeout_test (GtkWidget *widget) window); gtk_container_add (GTK_CONTAINER (action_area), button); gtk_window_set_default_widget (GTK_WINDOW (window), button); - gtk_widget_show (button); button = gtk_button_new_with_label ("start"); g_signal_connect (button, "clicked", G_CALLBACK(start_timeout_test), label); gtk_container_add (GTK_CONTAINER (action_area), button); - gtk_widget_show (button); button = gtk_button_new_with_label ("stop"); g_signal_connect (button, "clicked", G_CALLBACK (stop_timeout_test), NULL); gtk_container_add (GTK_CONTAINER (action_area), button); - gtk_widget_show (button); } if (!gtk_widget_get_visible (window)) @@ -6127,7 +6082,6 @@ create_main_window (void) gtk_widget_set_margin_end (box2, 10); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), box2); gtk_viewport_set_scroll_to_focus (GTK_VIEWPORT (gtk_widget_get_parent (box2)), TRUE); - gtk_widget_show (box2); for (i = 0; i < nbuttons; i++) { diff --git a/tests/testlist.c b/tests/testlist.c index c382097a11..497122844f 100644 --- a/tests/testlist.c +++ b/tests/testlist.c @@ -52,7 +52,6 @@ row_new (const gchar* text, gint sort_id) { { row->label = gtk_label_new (text); gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), row->label); - gtk_widget_show (row->label); } row->sort_id = sort_id; @@ -78,8 +77,6 @@ update_header_cb (Row *row, Row *before, gpointer data) gtk_container_add (GTK_CONTAINER (hbox), l); b = gtk_button_new_with_label ("button"); gtk_container_add (GTK_CONTAINER (hbox), b); - gtk_widget_show (l); - gtk_widget_show (b); gtk_list_box_row_set_header (GTK_LIST_BOX_ROW (row), hbox); } diff --git a/tests/testlist2.c b/tests/testlist2.c index 6b176a0fea..9c284417be 100644 --- a/tests/testlist2.c +++ b/tests/testlist2.c @@ -19,7 +19,6 @@ remove_this_row (GtkButton *button, GtkWidget *child) row = gtk_widget_get_parent (child); revealer = gtk_revealer_new (); gtk_revealer_set_reveal_child (GTK_REVEALER (revealer), TRUE); - gtk_widget_show (revealer); g_object_ref (child); gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (child)), child); gtk_revealer_set_child (GTK_REVEALER (revealer), child); diff --git a/tests/testmenubutton.c b/tests/testmenubutton.c index 814efcd74b..a1f1c78a9d 100644 --- a/tests/testmenubutton.c +++ b/tests/testmenubutton.c @@ -55,7 +55,6 @@ int main (int argc, char **argv) /* horizontal alignment */ label = gtk_label_new ("Horizontal Alignment:"); - gtk_widget_show (label); gtk_grid_attach (GTK_GRID (grid), label, 0, row++, 1, 1); combo = gtk_combo_box_text_new (); @@ -65,14 +64,12 @@ int main (int argc, char **argv) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Center"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Baseline"); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), INITIAL_HALIGN); - gtk_widget_show (combo); gtk_grid_attach_next_to (GTK_GRID (grid), combo, label, GTK_POS_RIGHT, 1, 1); g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (horizontal_alignment_changed), menubuttons); /* vertical alignment */ label = gtk_label_new ("Vertical Alignment:"); - gtk_widget_show (label); gtk_grid_attach (GTK_GRID (grid), label, 0, row++, 1, 1); combo = gtk_combo_box_text_new (); @@ -82,7 +79,6 @@ int main (int argc, char **argv) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Center"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Baseline"); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), INITIAL_HALIGN); - gtk_widget_show (combo); gtk_grid_attach_next_to (GTK_GRID (grid), combo, label, GTK_POS_RIGHT, 1, 1); g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (vertical_alignment_changed), menubuttons); diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c index 6ea0fa354e..31674219e6 100644 --- a/tests/testscrolledwindow.c +++ b/tests/testscrolledwindow.c @@ -87,8 +87,6 @@ scrollable_policy (void) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); - gtk_widget_show (vbox); - gtk_widget_show (hbox); gtk_window_set_child (GTK_WINDOW (window), hbox); gtk_container_add (GTK_CONTAINER (hbox), vbox); @@ -100,7 +98,6 @@ scrollable_policy (void) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_widget_show (swindow); gtk_frame_set_child (GTK_FRAME (frame), swindow); viewport = gtk_viewport_new (NULL, NULL); @@ -116,8 +113,6 @@ scrollable_policy (void) gtk_label_set_width_chars (GTK_LABEL (label), 40); gtk_label_set_max_width_chars (GTK_LABEL (label), 100); - gtk_widget_show (label); - gtk_widget_show (viewport); gtk_viewport_set_child (GTK_VIEWPORT (viewport), label); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), viewport); @@ -125,14 +120,11 @@ scrollable_policy (void) expander = gtk_expander_new ("Controls"); gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE); cntl = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - gtk_widget_show (cntl); - gtk_widget_show (expander); gtk_container_add (GTK_CONTAINER (expander), cntl); gtk_container_add (GTK_CONTAINER (vbox), expander); /* Add Horizontal policy control here */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); - gtk_widget_show (hbox); widget = gtk_label_new ("hscroll-policy"); gtk_widget_set_hexpand (widget, TRUE); @@ -152,7 +144,6 @@ scrollable_policy (void) /* Add Vertical policy control here */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); - gtk_widget_show (hbox); widget = gtk_label_new ("vscroll-policy"); gtk_widget_set_hexpand (widget, TRUE); @@ -181,8 +172,6 @@ scrollable_policy (void) gtk_widget_set_hexpand (widget, TRUE); gtk_container_add (GTK_CONTAINER (hbox), widget); gtk_container_add (GTK_CONTAINER (cntl), hbox); - gtk_widget_show (widget); - gtk_widget_show (hbox); g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (content_width_changed), swindow); @@ -197,8 +186,6 @@ scrollable_policy (void) gtk_widget_set_hexpand (widget, TRUE); gtk_container_add (GTK_CONTAINER (hbox), widget); gtk_container_add (GTK_CONTAINER (cntl), hbox); - gtk_widget_show (widget); - gtk_widget_show (hbox); g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (content_height_changed), swindow); @@ -233,7 +220,6 @@ scrollable_policy (void) /* Listbox */ listbox = gtk_list_box_new (); gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), listbox); - gtk_widget_show (listbox); /* Min content */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); diff --git a/tests/testselectionmode.c b/tests/testselectionmode.c index 39899109c1..7e912c9ae3 100644 --- a/tests/testselectionmode.c +++ b/tests/testselectionmode.c @@ -27,9 +27,6 @@ selectable_row_init (SelectableRow *row) gtk_widget_set_margin_top (row->check, 10); gtk_widget_set_margin_bottom (row->check, 10); - gtk_widget_show (row->box); - gtk_widget_show (row->check); - gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), row->box); gtk_container_add (GTK_CONTAINER (row->box), row->revealer); gtk_revealer_set_child (GTK_REVEALER (row->revealer), row->check); diff --git a/tests/testtreeview.c b/tests/testtreeview.c index a5648c6be9..da2e4b9630 100644 --- a/tests/testtreeview.c +++ b/tests/testtreeview.c @@ -362,9 +362,7 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) image = gtk_image_new_from_pixbuf (pixbuf); g_object_unref (pixbuf); - - gtk_widget_show (image); - + gtk_tree_view_column_set_widget (col, image); rend = gtk_cell_renderer_toggle_new (); diff --git a/tests/testwindowsize.c b/tests/testwindowsize.c index 99148869bf..0d3fc8ccbb 100644 --- a/tests/testwindowsize.c +++ b/tests/testwindowsize.c @@ -58,10 +58,8 @@ show_dialog (void) gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), label); - gtk_widget_show (label); label = gtk_label_new ("? x ?"); - //gtk_widget_show (label); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP); gtk_widget_realize (dialog);