diff options
author | wolfsuit <wolfsuit> | 2004-04-01 18:40:09 (GMT) |
---|---|---|
committer | wolfsuit <wolfsuit> | 2004-04-01 18:40:09 (GMT) |
commit | d09c2dc8fe0cc3d0e4252a6564c884880efabc65 (patch) | |
tree | 4d58bd2594cb85db70a3e6f54a5653babd87195a | |
parent | b9ce39098a3d287637df8f555df02d4822725bde (diff) | |
download | tk-d09c2dc8fe0cc3d0e4252a6564c884880efabc65.zip tk-d09c2dc8fe0cc3d0e4252a6564c884880efabc65.tar.gz tk-d09c2dc8fe0cc3d0e4252a6564c884880efabc65.tar.bz2 |
Fix for Bug 220871.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | macosx/tkMacOSXMenu.c | 26 |
2 files changed, 21 insertions, 10 deletions
@@ -1,3 +1,8 @@ +2004-03-31 Jim Ingham <jingham@apple.com> + + * tkMacOSXMenu.c (EventuallyInvokeMenu): Report errors from invoking + menu commands as background errors. [Bug 220871] + 2004-03-26 Donal K. Fellows <donal.k.fellows@man.ac.uk> * generic/tkImgPPM.c (ReadPPMStringHeader): Code to read PPM/PGM data diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 5ae94a7..8c95a32 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6.2.4 2004/02/16 00:42:34 wolfsuit Exp $ + * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6.2.5 2004/04/01 18:40:10 wolfsuit Exp $ */ #include "tkMacOSXInt.h" #include "tkMenuButton.h" @@ -141,9 +141,6 @@ typedef struct TopLevelMenubarList { #define CASCADE_CMD (0x1b) /* The special command char for cascade * menus. */ -#define SEPARATOR_TEXT "\p(-" - /* The text for a menu separator. */ - #define MENUBAR_REDRAW_PENDING 1 #define SCREEN_MARGIN 5 @@ -1079,7 +1076,9 @@ ReconfigureIndividualMenu( */ if (mePtr->type == SEPARATOR_ENTRY) { - AppendMenu(macMenuHdl, SEPARATOR_TEXT); + AppendMenuItemTextWithCFString (macMenuHdl, NULL, + kMenuItemAttrSeparator | kMenuItemAttrDisabled, + 0, NULL); } else { Tcl_DString itemTextDString; int destWrote; @@ -1087,13 +1086,12 @@ ReconfigureIndividualMenu( GetEntryText(mePtr, &itemTextDString); cf = CFStringCreateWithCString(NULL, Tcl_DStringValue(&itemTextDString), kCFStringEncodingUTF8); - AppendMenu(macMenuHdl, "\px"); if (cf != NULL) { - SetMenuItemTextWithCFString(macMenuHdl, base + index, cf); + AppendMenuItemTextWithCFString (macMenuHdl, cf, 0, 0, NULL); CFRelease(cf); } else { cf = CFSTR ("<Error>"); - SetMenuItemTextWithCFString(macMenuHdl, base + index, cf); + AppendMenuItemTextWithCFString (macMenuHdl, cf, 0, 0, NULL); } Tcl_DStringFree(&itemTextDString); @@ -2099,11 +2097,19 @@ EventuallyInvokeMenu (ClientData data) { struct MenuCommandHandlerData *realData = (struct MenuCommandHandlerData *) data; + int code; + code = TkInvokeMenu(realData->menuPtr->interp, realData->menuPtr, + realData->index); + + if (code != TCL_OK && code != TCL_CONTINUE + && code != TCL_BREAK) { + Tcl_AddErrorInfo(realData->menuPtr->interp, "\n (menu invoke)"); + Tcl_BackgroundError(realData->menuPtr->interp); + } + Tcl_Release(realData->menuPtr->interp); Tcl_Release(realData->menuPtr); - TkInvokeMenu(realData->menuPtr->interp, realData->menuPtr, - realData->index); } /* |