[Pioneers-commits] r6 - trunk/client/gtk

kemm at garage.maemo.org kemm at garage.maemo.org
Sat Jan 5 14:45:56 EET 2008


Author: kemm
Date: 2008-01-05 14:45:56 +0200 (Sat, 05 Jan 2008)
New Revision: 6

Modified:
   trunk/client/gtk/gui.c
Log:
Fix menu creation


Modified: trunk/client/gtk/gui.c
===================================================================
--- trunk/client/gtk/gui.c	2007-12-30 21:58:51 UTC (rev 5)
+++ trunk/client/gtk/gui.c	2008-01-05 12:45:56 UTC (rev 6)
@@ -278,7 +278,7 @@
 /* *INDENT-OFF* */
 static const char *ui_description =
 "<ui>"
-"  <menubar name='MainMenu'>"
+"  <popup name='MainMenu'>"
 "    <menu action='GameMenu'>"
 "      <menuitem action='GameNew'/>"
 "      <menuitem action='GameLeave'/>"
@@ -319,7 +319,7 @@
 "      <menuitem action='HelpManual'/>"
 #endif
 "    </menu>"
-"  </menubar>"
+"  </popup>"
 "  <toolbar name='MainToolbar'>"
 "    <toolitem action='RollDice'/>"
 "    <toolitem action='Trade'/>"
@@ -1455,7 +1455,6 @@
 	GError *error = NULL;
 	gchar *icon_file;
     HildonProgram *program;
-    GtkWidget *menu;
 
 	player_init();
 
@@ -1528,12 +1527,10 @@
 	menubar = gtk_ui_manager_get_widget(ui_manager, "/MainMenu");
 	//gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
     ////hildon_window_set_menu(HILDON_WINDOW(app_window), GTK_MENU(menubar));
-    menu = gtk_menu_new();
-    gtk_container_foreach(GTK_CONTAINER(menubar), (GtkCallback)gtk_widget_reparent, menu);
-    hildon_window_set_menu(HILDON_WINDOW(app_window), GTK_MENU(menu));
+    hildon_window_set_menu(HILDON_WINDOW(app_window), GTK_MENU(menubar));
 
 	toolbar = gtk_ui_manager_get_widget(ui_manager, "/MainToolbar");
-	gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
+	//gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
 	gtk_box_pack_start(GTK_BOX(vbox), build_main_interface(), TRUE,
 			   TRUE, 0);
 	gtk_box_pack_start(GTK_BOX(vbox), build_status_bar(), FALSE, FALSE,
@@ -1551,6 +1548,9 @@
 	g_signal_connect(G_OBJECT(app_window), "key_press_event",
 			 G_CALLBACK(hotkeys_handler), NULL);
 
+    hildon_window_add_toolbar(HILDON_WINDOW(app_window), GTK_TOOLBAR(toolbar));
+    gtk_widget_show_all(toolbar);
+
 	gtk_widget_show(app_window);
 
 	frontend_gui_register_action(getAction(GUI_CONNECT), GUI_CONNECT);



More information about the Pioneers-commits mailing list