| 5742 | |
| 5743 | // GTK-OSX-APPLICATION |
| 5744 | GtkosxApplication *theApp = g_object_new (GTKOSX_TYPE_APPLICATION, NULL); |
| 5745 | GtkWidget *osx_menubar, *osx_help, *osx_about, *osx_preferences, *osx_quit; |
| 5746 | |
| 5747 | // Define objects from gnumeric |
| 5748 | osx_menubar = gtk_ui_manager_get_widget (wbcg->ui, "/ui/menubar"); |
| 5749 | osx_help = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/Help/Help"); |
| 5750 | osx_about = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/Help/HelpAbout"); |
| 5751 | osx_preferences = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/Edit/EditPreferences"); |
| 5752 | osx_quit = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/File/FileQuit"); |
| 5753 | |
| 5754 | // Make the OS X menu bar object |
| 5755 | gtkosx_application_set_menu_bar (theApp, GTK_MENU_SHELL (osx_menubar)); |
| 5756 | gtkosx_application_set_help_menu (theApp, GTK_MENU_ITEM (osx_help)); |
| 5757 | gtkosx_application_set_window_menu (theApp, NULL); |
| 5758 | gtkosx_application_set_use_quartz_accelerators (theApp, TRUE); |
| 5759 | |
| 5760 | // Rearange certain menu items the way OS X users expect to see them |
| 5761 | gtkosx_application_insert_app_menu_item (theApp, osx_about, 1); |
| 5762 | gtkosx_application_insert_app_menu_item (theApp, gtk_separator_menu_item_new (), 2); |
| 5763 | gtkosx_application_insert_app_menu_item (theApp, osx_preferences, 3); |
| 5764 | gtkosx_application_insert_app_menu_item (theApp, gtk_separator_menu_item_new (), 4); |
| 5765 | |
| 5766 | // Hide the original menu items, but Window menu doesn't work... |
| 5767 | gtk_widget_hide (osx_menubar); |
| 5768 | gtk_widget_hide (osx_quit); |
| 5769 | |
| 5770 | // Tell OS X to show the menu bar |
| 5771 | gtkosx_application_ready (theApp); |
| 5772 | //END GTK-OSX-APPLICATION |