diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-09 11:50:19 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-09 11:50:19 (GMT) |
commit | aff38ee930b8b62b99c03fd79c2fb03f8f27c85f (patch) | |
tree | 77d59773feece114c78cae0e5d0095f3a8c6bdea /macosx/tkMacOSXMenu.c | |
parent | f12a8565b7dec286dead34e157892fed3202f352 (diff) | |
parent | b33639f20e412831ed8724517ba70b2cdab6be57 (diff) | |
download | tk-aff38ee930b8b62b99c03fd79c2fb03f8f27c85f.zip tk-aff38ee930b8b62b99c03fd79c2fb03f8f27c85f.tar.gz tk-aff38ee930b8b62b99c03fd79c2fb03f8f27c85f.tar.bz2 |
merge trunkjn_web_colors
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r-- | macosx/tkMacOSXMenu.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index d6f9ef1..8054c57 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -669,20 +669,25 @@ TkpConfigureMenuEntry( submenu = nil; } else { [submenu setTitle:title]; + + if ([menuItem isEnabled]) { + /* This menuItem might have been previously disabled (XXX: + track this), which would have disabled entries; we must + re-enable the entries here. */ + int i = 0; + NSArray *itemArray = [submenu itemArray]; + for (NSMenuItem *item in itemArray) { + TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i]; + [item setEnabled: !(submePtr->state == ENTRY_DISABLED)]; + i++; + } + } + } } } [menuItem setSubmenu:submenu]; - /*Disabling parent menu disables entries; we must re-enable the entries here.*/ - NSArray *itemArray = [submenu itemArray]; - - if ([menuItem isEnabled]) { - for (NSMenuItem *item in itemArray) { - [item setEnabled:YES]; - } - } - return TCL_OK; } |