diff options
author | kevin_walzer <kevin_walzer@noemail.net> | 2012-08-06 01:29:16 (GMT) |
---|---|---|
committer | kevin_walzer <kevin_walzer@noemail.net> | 2012-08-06 01:29:16 (GMT) |
commit | 3f315d7ba14fce788dafdf15f8de112b1204d097 (patch) | |
tree | 53ccee50223d509344d4934095cf76d5571ad22b /macosx/tkMacOSXMenu.c | |
parent | 83c54409136e068ce3377f213fa2bd821dd7a56b (diff) | |
download | tk-3f315d7ba14fce788dafdf15f8de112b1204d097.zip tk-3f315d7ba14fce788dafdf15f8de112b1204d097.tar.gz tk-3f315d7ba14fce788dafdf15f8de112b1204d097.tar.bz2 |
Fixes for menu and wm fullscreen bugs; thanks to Adrian Robert for patches
FossilOrigin-Name: fcb2b908ec385a9732c9de27c70f6b88876ae948
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; } |