From 465713a168ea9070579738f9e4313f876da74875 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 11 Sep 2014 23:10:59 +0200 Subject: [PATCH] Fix checkmarking of OS X menu items The routine MarkMenuItem() was moved to xboard.c, where it can see the OSX-specific #defines, and calls to sync_menu_bar were added to it, and to EnableNamendMenuItem(). --- gtk/xboard.c | 14 ++++++++++++++ gtk/xoptions.c | 10 ---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gtk/xboard.c b/gtk/xboard.c index 532df06..d8fcbaa 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -180,11 +180,13 @@ extern char *getenv(); # define ICS_LOGON "Library/Preferences/XboardICS.conf" # define DATADIR dataDir # define SETTINGS_FILE masterSettings +# define SYNC_MENUBAR gtkosx_application_sync_menubar(theApp) char dataDir[MSG_SIZ]; // for expanding ~~ char masterSettings[MSG_SIZ]; #else # define SLASH '/' # define IMG ".svg" +# define SYNC_MENUBAR #endif #ifdef __EMX__ @@ -1466,11 +1468,23 @@ FindFont (char *pattern, int targetPxlSize) #endif void +MarkMenuItem (char *menuRef, int state) +{ + MenuItem *item = MenuNameToItem(menuRef); + + if(item && item->handle) { + ((GtkCheckMenuItem *) (item->handle))->active = state; + } + SYNC_MENUBAR; +} + +void EnableNamedMenuItem (char *menuRef, int state) { MenuItem *item = MenuNameToItem(menuRef); if(item && item->handle) gtk_widget_set_sensitive(item->handle, state); + SYNC_MENUBAR; } void diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 8b4c98a..5df840b 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -138,16 +138,6 @@ static Arg formArgs[] = { }; #endif -void -MarkMenuItem (char *menuRef, int state) -{ - MenuItem *item = MenuNameToItem(menuRef); - - if(item && item->handle) { - ((GtkCheckMenuItem *) (item->handle))->active = state; - } -} - void GetWidgetTextGTK(GtkWidget *w, char **buf) { GtkTextIter start; -- 1.7.0.4