Ticket #40419: patch_quartz-src-wbc-gtk.c.diff

File patch_quartz-src-wbc-gtk.c.diff, 2.0 KB (added by c.herbig@…, 11 years ago)
  • src/

    old new  
    6969#include "gnm-i18n.h"
    7070#include <errno.h>
    7171#include <string.h>
     72#include <gtkmacintegration/gtkosxapplication.h>
    7273
    7374#define GET_GUI_ITEM(i_) (gpointer)(gtk_builder_get_object(wbcg->gui, (i_)))
    7475
     
    56875688        }
    56885689        g_free (uifile);
    56895690
     5691        // GTK-OSX-APPLICATION
     5692    GtkosxApplication *theApp = g_object_new (GTKOSX_TYPE_APPLICATION, NULL);
     5693    GtkWidget *osx_menubar, *osx_help, *osx_about, *osx_preferences, *osx_quit;
     5694   
     5695        // Define objects from gnumeric
     5696    osx_menubar = gtk_ui_manager_get_widget (wbcg->ui, "/ui/menubar");
     5697    osx_help = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/Help/Help");
     5698    osx_about = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/Help/HelpAbout");
     5699    osx_preferences = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/Edit/EditPreferences");
     5700    osx_quit = gtk_ui_manager_get_widget (wbcg->ui, "/menubar/File/FileQuit");
     5701   
     5702        // Make the OS X menu bar object
     5703    gtkosx_application_set_menu_bar (theApp, GTK_MENU_SHELL (osx_menubar));
     5704    gtkosx_application_set_help_menu (theApp, GTK_MENU_ITEM (osx_help));
     5705    gtkosx_application_set_use_quartz_accelerators (theApp, TRUE);
     5706   
     5707        // Rearange certain menu items the way OS X users expect to see them
     5708    gtkosx_application_insert_app_menu_item (theApp, osx_about, 1);
     5709    gtkosx_application_insert_app_menu_item (theApp, gtk_separator_menu_item_new (), 2);
     5710    gtkosx_application_insert_app_menu_item (theApp, osx_preferences, 3);
     5711    gtkosx_application_insert_app_menu_item (theApp, gtk_separator_menu_item_new (), 4);
     5712   
     5713        // Hide the original menu items, but Window menu doesn't work...
     5714    gtk_widget_hide (osx_menubar);
     5715    gtk_widget_hide (osx_quit);
     5716   
     5717        // Tell OS X to show the menu bar
     5718    gtkosx_application_ready (theApp);
     5719        //END GTK-OSX-APPLICATION   
     5720   
    56905721        wbcg->custom_uis = g_hash_table_new_full (g_direct_hash, g_direct_equal,
    56915722                                                 NULL, g_free);
    56925723