diff options
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r-- | macosx/tkMacOSXMenu.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index e1cdc76..85e1d6c 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -269,7 +269,7 @@ static int ModifierCharWidth(Tk_Font tkfont); if (result != TCL_OK && result != TCL_CONTINUE && result != TCL_BREAK) { Tcl_AddErrorInfo(interp, "\n (menu invoke)"); - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, result); } Tcl_Release(menuPtr); Tcl_Release(interp); @@ -359,7 +359,7 @@ static int ModifierCharWidth(Tk_Font tkfont); if (result!=TCL_OK && result!=TCL_CONTINUE && result!=TCL_BREAK) { Tcl_AddErrorInfo(interp, "\n (menu preprocess)"); - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, result); } Tcl_Release(menuPtr); Tcl_Release(interp); @@ -683,18 +683,18 @@ 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 + TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i]; + /* Work around an apparent bug where itemArray can have more items than the menu's entries[] array. */ if (i >= menuRefPtr->menuPtr->numEntries) break; - [item setEnabled: !(submePtr->state == ENTRY_DISABLED)]; - i++; + [item setEnabled: !(submePtr->state == ENTRY_DISABLED)]; + i++; } } + } } } - [menuItem setSubmenu:submenu]; return TCL_OK; @@ -757,7 +757,7 @@ TkpPostMenu( * to be posted. */ int y) /* The global y-coordinate */ { - + /* Get the object that holds this Tk Window.*/ Tk_Window root; @@ -765,11 +765,11 @@ TkpPostMenu( if (root == NULL) { return TCL_ERROR; } - + Drawable d = Tk_WindowId(root); NSView *rootview = TkMacOSXGetRootControl(d); NSWindow *win = [rootview window]; - + inPostMenu = 1; int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); @@ -838,12 +838,12 @@ TkpSetWindowMenuBar( * *---------------------------------------------------------------------- */ - + void TkpSetMainMenubar( Tcl_Interp *interp, /* The interpreter of the application */ Tk_Window tkwin, /* The frame we are setting up */ - char *menuName) /* The name of the menu to put in front. If + const char *menuName) /* The name of the menu to put in front. If * NULL, use the default menu bar. */ { static Tcl_Interp *currentInterp = NULL; @@ -1454,10 +1454,10 @@ TkpMenuInit(void) [NSMenuItem setUsesUserKeyEquivalents:NO]; tkColPtr = TkpGetColor(None, DEF_MENU_BG_COLOR); defaultBg = tkColPtr->color.pixel; - ckfree((char *) tkColPtr); + ckfree(tkColPtr); tkColPtr = TkpGetColor(None, DEF_MENU_FG); defaultFg = tkColPtr->color.pixel; - ckfree((char *) tkColPtr); + ckfree(tkColPtr); ChkErr(GetThemeMetric, kThemeMetricMenuMarkColumnWidth, &menuMarkColumnWidth); @@ -1520,7 +1520,7 @@ TkpMenuThreadInit(void) void TkpMenuNotifyToplevelCreate( Tcl_Interp *interp, /* The interp the menu lives in. */ - char *menuName) /* The name of the menu to reconfigure. */ + const char *menuName) /* The name of the menu to reconfigure. */ { /* * Nothing to do. |