From: H.G.Muller Date: Thu, 11 Sep 2014 21:10:59 +0000 (+0200) Subject: Fix checkmarking of OS X menu items X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=465713a168ea9070579738f9e4313f876da74875;hp=690bca7dd56930de9ce6398b99a9d61a3bcbbee1;p=xboard.git 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(). --- 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;