]> Pileus Git - ~andy/gtk/blobdiff - tests/testrecentchoosermenu.c
label: refactor code
[~andy/gtk] / tests / testrecentchoosermenu.c
index d22ef012e326103334e497fbfc69b6570cdd4dbd..d5822e8369782cfa0cbb92a9c91372439b0389e9 100644 (file)
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <config.h>
+#include "config.h"
 #include <gtk/gtk.h>
 
 static GtkRecentManager *manager = NULL;
@@ -81,8 +79,6 @@ create_recent_chooser_menu (gint limit)
                     G_CALLBACK (item_activated_cb),
                     NULL);
 
-  gtk_widget_show (menu);
-
   menuitem = gtk_separator_menu_item_new ();
   gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
   gtk_widget_show (menuitem);
@@ -103,6 +99,8 @@ create_recent_chooser_menu (gint limit)
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
   gtk_widget_show (menuitem);
 
+  gtk_widget_show_all (menu);
+
   return menu;
 }
 
@@ -164,7 +162,7 @@ main (int argc, char *argv[])
   accel_group = gtk_accel_group_new ();
   gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
   
-  box = gtk_vbox_new (FALSE, 0);
+  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_container_add (GTK_CONTAINER (window), box);
   gtk_widget_show (box);
 
@@ -193,7 +191,7 @@ main (int argc, char *argv[])
                             G_CALLBACK (gtk_widget_destroy),
                             window);
   gtk_box_pack_end (GTK_BOX (box), button, TRUE, TRUE, 0);
-  GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+  gtk_widget_set_can_default (button, TRUE);
   gtk_widget_grab_default (button);
   gtk_widget_show (button);