summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenu.c
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2020-11-19 14:29:01 (GMT)
committermarc_culler <marc.culler@gmail.com>2020-11-19 14:29:01 (GMT)
commitfc5fd5cb8a45e236e7bdc80cf6e1042e57f3474c (patch)
treec460fd4840d7f11f37dc159b7c3611b3bf99eb46 /macosx/tkMacOSXMenu.c
parentae6a133a8d5afca88ae4c374a1798b37305cce52 (diff)
downloadtk-fc5fd5cb8a45e236e7bdc80cf6e1042e57f3474c.zip
tk-fc5fd5cb8a45e236e7bdc80cf6e1042e57f3474c.tar.gz
tk-fc5fd5cb8a45e236e7bdc80cf6e1042e57f3474c.tar.bz2
Better fix, for special menus other than Help: iterate through Tk menu entries, not NSMenuItems.
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r--macosx/tkMacOSXMenu.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 29085a0..db1d5eb 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -783,22 +783,10 @@ TkpConfigureMenuEntry(
* re-enable the entries here.
*/
- int i = 0;
- NSArray *itemArray = [submenu itemArray];
- for (NSMenuItem *item in itemArray) {
+ for (int i = 0; i < menuRefPtr->menuPtr->numEntries; i++) {
TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i];
-
- /*
- * 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 (mePtr->entryFlags && i == 0) {
- continue;
- }
- [item setEnabled: !(submePtr->state == ENTRY_DISABLED)];
- i++;
+ NSMenuItem *item = (NSMenuItem *) mePtr->platformEntryData;
+ [item setEnabled: submePtr->state != ENTRY_DISABLED];
}
}
}