diff options
author | culler <culler> | 2020-11-18 22:58:23 (GMT) |
---|---|---|
committer | culler <culler> | 2020-11-18 22:58:23 (GMT) |
commit | ae6a133a8d5afca88ae4c374a1798b37305cce52 (patch) | |
tree | 00c3211aa15b3ecf8c810fd410c2cb1dc5c65730 /macosx | |
parent | c44eec6b68992aec638c2283da7951b7942aab46 (diff) | |
download | tk-ae6a133a8d5afca88ae4c374a1798b37305cce52.zip tk-ae6a133a8d5afca88ae4c374a1798b37305cce52.tar.gz tk-ae6a133a8d5afca88ae4c374a1798b37305cce52.tar.bz2 |
Fix [7185d26cf4]: macOS menu items before separators in special menus are disabled.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXMenu.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 3d5a996..29085a0 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -785,17 +785,17 @@ TkpConfigureMenuEntry( int i = 0; NSArray *itemArray = [submenu itemArray]; - for (NSMenuItem *item in itemArray) { TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i]; /* - * Work around an apparent bug where itemArray can have - * more items than the menu's entries[] array. + * if this is a special menu in a menubar, skip the + * first item, which will have been added by the system + * and will be unknown to Tk. */ - if (i >= (int) menuRefPtr->menuPtr->numEntries) { - break; + if (mePtr->entryFlags && i == 0) { + continue; } [item setEnabled: !(submePtr->state == ENTRY_DISABLED)]; i++; |