diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkMenu.c | 14 | ||||
-rw-r--r-- | generic/tkMenu.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c index e798337..2c0f9a9 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -870,10 +870,10 @@ MenuWidgetObjCmd( break; } case MENU_POST: { - int x, y, entry = -1; + int x, y, index = -1; if (objc != 4 && objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "x y ?entry?"); + Tcl_WrongNumArgs(interp, 2, objv, "x y ?index?"); goto error; } if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) @@ -881,9 +881,9 @@ MenuWidgetObjCmd( goto error; } if (objc == 5) { - if (Tcl_GetIntFromObj(interp, objv[4], &entry) != TCL_OK) { - goto error; - } + if (TkGetMenuIndex(interp, menuPtr, objv[4], 0, &index) != TCL_OK) { + goto error; + } } /* @@ -898,9 +898,9 @@ MenuWidgetObjCmd( Tcl_AppendResult(interp, "a menubar menu cannot be posted", NULL); return TCL_ERROR; } else if (menuPtr->menuType != TEAROFF_MENU) { - result = TkpPostMenu(interp, menuPtr, x, y, entry); + result = TkpPostMenu(interp, menuPtr, x, y, index); } else { - result = TkpPostTearoffMenu(interp, menuPtr, x, y, entry); + result = TkpPostTearoffMenu(interp, menuPtr, x, y, index); } break; } diff --git a/generic/tkMenu.h b/generic/tkMenu.h index 2c4e051..6d1fe5a 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -543,9 +543,9 @@ MODULE_SCOPE void TkpMenuInit(void); MODULE_SCOPE int TkpMenuNewEntry(TkMenuEntry *mePtr); MODULE_SCOPE int TkpNewMenu(TkMenu *menuPtr); MODULE_SCOPE int TkpPostMenu(Tcl_Interp *interp, TkMenu *menuPtr, - int x, int y, int entry); + int x, int y, int index); MODULE_SCOPE int TkpPostTearoffMenu(Tcl_Interp *interp, TkMenu *menuPtr, - int x, int y, int entry); + int x, int y, int index); MODULE_SCOPE void TkpSetWindowMenuBar(Tk_Window tkwin, TkMenu *menuPtr); #endif /* _TKMENU */ |