[gtk+] tests: Remove some unneeded gtk_widget_show calls



commit af0d876bb7da883af10fc4517de67d2318bf099b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 19 16:22:28 2018 +0100

    tests: Remove some unneeded gtk_widget_show calls
    
    Widgets are visible by default now.

 tests/testnotebookdnd.c       |    3 ---
 tests/testrecentchoosermenu.c |   20 --------------------
 tests/testscrolledge.c        |    2 --
 tests/testtextview.c          |    5 -----
 tests/testtreeedit.c          |    7 +------
 5 files changed, 1 insertions(+), 36 deletions(-)
---
diff --git a/tests/testnotebookdnd.c b/tests/testnotebookdnd.c
index 9fd00e6..5d87a90 100644
--- a/tests/testnotebookdnd.c
+++ b/tests/testnotebookdnd.c
@@ -142,7 +142,6 @@ action_clicked_cb (GtkWidget *button,
 
   page = gtk_entry_new ();
   gtk_entry_set_text (GTK_ENTRY (page), "Addition");
-  gtk_widget_show (page);
 
   title = gtk_label_new ("Addition");
 
@@ -164,7 +163,6 @@ create_notebook (gchar           **labels,
 
   action_widget = gtk_button_new_from_icon_name ("list-add-symbolic");
   g_signal_connect (action_widget, "clicked", G_CALLBACK (action_clicked_cb), notebook);
-  gtk_widget_show (action_widget);
   gtk_notebook_set_action_widget (GTK_NOTEBOOK (notebook), action_widget, GTK_PACK_END);
 
   g_signal_connect (notebook, "create-window",
@@ -208,7 +206,6 @@ create_notebook_non_dragable_content (gchar           **labels,
 
   action_widget = gtk_button_new_from_icon_name ("list-add-symbolic");
   g_signal_connect (action_widget, "clicked", G_CALLBACK (action_clicked_cb), notebook);
-  gtk_widget_show (action_widget);
   gtk_notebook_set_action_widget (GTK_NOTEBOOK (notebook), action_widget, GTK_PACK_END);
 
   g_signal_connect (notebook, "create-window",
diff --git a/tests/testrecentchoosermenu.c b/tests/testrecentchoosermenu.c
index ba0710a..0a8d278 100644
--- a/tests/testrecentchoosermenu.c
+++ b/tests/testrecentchoosermenu.c
@@ -81,25 +81,18 @@ create_recent_chooser_menu (gint limit)
 
   menuitem = gtk_separator_menu_item_new ();
   gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_menu_item_new_with_label ("Test prepend");
   gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_separator_menu_item_new ();
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_menu_item_new_with_label ("Test append");
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_menu_item_new_with_mnemonic ("Clear");
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
-
-  gtk_widget_show (menu);
 
   return menu;
 }
@@ -115,27 +108,20 @@ create_file_menu (GtkAccelGroup *accelgroup)
 
   menuitem = gtk_menu_item_new_with_mnemonic ("_New");
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_menu_item_new_with_mnemonic ("_Open");
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_menu_item_new_with_mnemonic ("_Open Recent");
   recentmenu = create_recent_chooser_menu (-1);
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), recentmenu);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_separator_menu_item_new ();
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
 
   menuitem = gtk_menu_item_new_with_mnemonic ("_Quit");
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-  gtk_widget_show (menuitem);
-
-  gtk_widget_show (menu);
 
   return menu;
 }
@@ -164,27 +150,22 @@ main (int argc, char *argv[])
 
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_container_add (GTK_CONTAINER (window), box);
-  gtk_widget_show (box);
 
   menubar = gtk_menu_bar_new ();
   gtk_box_pack_start (GTK_BOX (box), menubar);
-  gtk_widget_show (menubar);
 
   menu = create_file_menu (accel_group);
   menuitem = gtk_menu_item_new_with_mnemonic ("_File");
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
   gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
-  gtk_widget_show (menuitem);
 
   menu = create_recent_chooser_menu (4);
   menuitem = gtk_menu_item_new_with_mnemonic ("_Recently Used");
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
   gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
-  gtk_widget_show (menuitem);
 
   label = gtk_label_new ("No recent item selected");
   gtk_box_pack_start (GTK_BOX (box), label);
-  gtk_widget_show (label);
 
   button = gtk_button_new_with_label ("Close");
   g_signal_connect_swapped (button, "clicked",
@@ -193,7 +174,6 @@ main (int argc, char *argv[])
   gtk_box_pack_end (GTK_BOX (box), button);
   gtk_widget_set_can_default (button, TRUE);
   gtk_widget_grab_default (button);
-  gtk_widget_show (button);
 
   gtk_widget_show (window);
 
diff --git a/tests/testscrolledge.c b/tests/testscrolledge.c
index 3844575..03a0b66 100644
--- a/tests/testscrolledge.c
+++ b/tests/testscrolledge.c
@@ -108,8 +108,6 @@ main (int argc, char *argv[])
   g_object_set (popup, "margin", 40, NULL);
   label = gtk_label_new ("Getting more rows...");
   spinner = gtk_spinner_new ();
-  gtk_widget_show (spinner);
-  gtk_widget_show (label);
   gtk_container_add (GTK_CONTAINER (popup), label);
   gtk_container_add (GTK_CONTAINER (popup), spinner);
 
diff --git a/tests/testtextview.c b/tests/testtextview.c
index 793f162..f24014f 100644
--- a/tests/testtextview.c
+++ b/tests/testtextview.c
@@ -214,11 +214,6 @@ main (int argc, char **argv)
   create_tags (buffer);
   anchor = insert_text (buffer);
 
-  gtk_widget_show (button);
-  gtk_widget_show (button2);
-  gtk_widget_show (textview);
-  gtk_widget_show (sw);
-
   gtk_container_add (GTK_CONTAINER (window), sw);
   gtk_container_add (GTK_CONTAINER (sw), textview);
   gtk_text_view_add_child_in_window (GTK_TEXT_VIEW (textview),
diff --git a/tests/testtreeedit.c b/tests/testtreeedit.c
index ce5a872..ad41714 100644
--- a/tests/testtreeedit.c
+++ b/tests/testtreeedit.c
@@ -207,7 +207,6 @@ create_control (GtkWidget *box, gint number, gint cntl, CallbackData *data)
     }
 
   checkbutton = gtk_check_button_new_with_label (name);
-  gtk_widget_show (checkbutton);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), cntl == CNTL_FIXED);
   gtk_box_pack_start (GTK_BOX (box), checkbutton);
 
@@ -239,7 +238,6 @@ main (gint argc, gchar **argv)
   g_signal_connect (window, "destroy", gtk_main_quit, NULL);
 
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-  gtk_widget_show (vbox);
   gtk_container_add (GTK_CONTAINER (window), vbox);
 
   scrolled_window = gtk_scrolled_window_new (NULL, NULL);
@@ -352,12 +350,10 @@ main (gint argc, gchar **argv)
                               800, 250);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-  gtk_widget_show (hbox);
   gtk_box_pack_start (GTK_BOX (vbox), hbox);
 
   /* Alignment controls */
   cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
-  gtk_widget_show (cntl_vbox);
   gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox);
 
   create_control (cntl_vbox, 1, CNTL_ALIGN, &callback[0]);
@@ -367,7 +363,6 @@ main (gint argc, gchar **argv)
 
   /* Expand controls */
   cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
-  gtk_widget_show (cntl_vbox);
   gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox);
 
   create_control (cntl_vbox, 1, CNTL_EXPAND, &callback[0]);
@@ -377,7 +372,6 @@ main (gint argc, gchar **argv)
 
   /* Fixed controls */
   cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
-  gtk_widget_show (cntl_vbox);
   gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox);
 
   create_control (cntl_vbox, 1, CNTL_FIXED, &callback[0]);
@@ -386,6 +380,7 @@ main (gint argc, gchar **argv)
   create_control (cntl_vbox, 4, CNTL_FIXED, &callback[3]);
 
   gtk_widget_show (window);
+
   gtk_main ();
 
   return 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]