diff options
author | welch <welch@noemail.net> | 1998-08-13 13:36:34 (GMT) |
---|---|---|
committer | welch <welch@noemail.net> | 1998-08-13 13:36:34 (GMT) |
commit | aba950bd2c0b5ae4696e79602a2c787dbac3e8a5 (patch) | |
tree | d734a8cef0d167aa136f5091dbdeeee6f0ba5589 /mac/tkMacMenu.c | |
parent | e89dd0930e7ba6d1c2fa3047d13b58fdac2b52a6 (diff) | |
download | tk-aba950bd2c0b5ae4696e79602a2c787dbac3e8a5.zip tk-aba950bd2c0b5ae4696e79602a2c787dbac3e8a5.tar.gz tk-aba950bd2c0b5ae4696e79602a2c787dbac3e8a5.tar.bz2 |
Updates from Jim Ingham
FossilOrigin-Name: f3805deac224f513bfbae88c99b30b2550c4d933
Diffstat (limited to 'mac/tkMacMenu.c')
-rw-r--r-- | mac/tkMacMenu.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/mac/tkMacMenu.c b/mac/tkMacMenu.c index 51fc355..4f98a81 100644 --- a/mac/tkMacMenu.c +++ b/mac/tkMacMenu.c @@ -241,7 +241,7 @@ static void DrawTearoffEntry _ANSI_ARGS_((TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, GC gc, Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, int x, int y, int width, int height)); -static void FixMDEF _ANSI_ARGS_((void)); +static Handle FixMDEF _ANSI_ARGS_((void)); static void GetMenuAccelGeometry _ANSI_ARGS_((TkMenu *menuPtr, TkMenuEntry *mePtr, Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, int *modWidthPtr, @@ -501,9 +501,8 @@ TkpNewMenu( macMenuHdl = NewMenu(menuID, itemText); #ifdef GENERATINGCFM { - Handle mdefProc = GetResource('MDEF', 591); - Handle sicnHandle = GetResource('SICN', SICN_RESOURCE_NUMBER); - if ((mdefProc != NULL) && (sicnHandle != NULL)) { + Handle mdefProc = FixMDEF(); + if ((mdefProc != NULL)) { (*macMenuHdl)->menuProc = mdefProc; } } @@ -3917,7 +3916,8 @@ TkMacClearMenubarActive(void) { if ((menuBarRefPtr != NULL) && (menuBarRefPtr->menuPtr != NULL)) { TkMenu *menuPtr; - for (menuPtr = menuBarRefPtr->menuPtr->masterMenuPtr; menuPtr != NULL; + for (menuPtr = menuBarRefPtr->menuPtr->masterMenuPtr; + menuPtr != NULL; menuPtr = menuPtr->nextInstancePtr) { if (menuPtr->menuType == MENUBAR) { RecursivelyClearActiveMenu(menuPtr); @@ -3975,15 +3975,15 @@ TkpMenuNotifyToplevelCreate( * figure it out. * * Results: - * None. + * Returns the MDEF handle. * * Side effects: - * Allcates a hash table. + * The MDEF is read in and massaged. * *---------------------------------------------------------------------- */ -static void +static Handle FixMDEF(void) { #ifdef GENERATINGCFM @@ -3991,10 +3991,17 @@ FixMDEF(void) Handle SICNHandle = GetResource('SICN', SICN_RESOURCE_NUMBER); if ((MDEFHandle != NULL) && (SICNHandle != NULL)) { HLock(MDEFHandle); - HLock(MDEFHandle); - menuDefProc = TkNewMenuDefProc(MenuDefProc); + HLock(SICNHandle); + if (menuDefProc == NULL) { + menuDefProc = TkNewMenuDefProc(MenuDefProc); + } memmove((void *) (((long) (*MDEFHandle)) + 0x24), &menuDefProc, 4); + return MDEFHandle; + } else { + return NULL; } +#else + return NULL; #endif } |