summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixMenu.c
diff options
context:
space:
mode:
authorculler <culler>2019-01-15 14:00:45 (GMT)
committerculler <culler>2019-01-15 14:00:45 (GMT)
commit4330a830cd514bf17caac0cfe5b29fef47022df7 (patch)
tree668c9ed0e4c7ac335ebabf300ddbd8dbc5e186c1 /unix/tkUnixMenu.c
parentfe7e4b1e7f825147345d7e42707be7d53b72c904 (diff)
downloadtk-4330a830cd514bf17caac0cfe5b29fef47022df7.zip
tk-4330a830cd514bf17caac0cfe5b29fef47022df7.tar.gz
tk-4330a830cd514bf17caac0cfe5b29fef47022df7.tar.bz2
Use TkGetMenuIndex to parse the index argument to the post command.
Diffstat (limited to 'unix/tkUnixMenu.c')
-rw-r--r--unix/tkUnixMenu.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index c5c83ce..d7ed873 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -907,9 +907,9 @@ int
TkpPostMenu(
Tcl_Interp *interp,
TkMenu *menuPtr,
- int x, int y, int entry)
+ int x, int y, int index)
{
- return TkpPostTearoffMenu(interp, menuPtr, x, y, entry);
+ return TkpPostTearoffMenu(interp, menuPtr, x, y, index);
}
/*
@@ -919,7 +919,7 @@ TkpPostMenu(
*
* Posts a tearoff menu on the screen so that the top left corner of the
* specified entry is located at the point (x, y) in screen coordinates.
- * If the entry parameter is negative, the upper left corner of the menu
+ * If the index parameter is negative, the upper left corner of the menu
* itself is placed at the point. On unix this is called when posting
* any menu. Adjusts the menu's position so that it fits on the screen,
* and maps and raises the menu.
@@ -937,17 +937,17 @@ int
TkpPostTearoffMenu(
Tcl_Interp *interp, /* The interpreter of the menu */
TkMenu *menuPtr, /* The menu we are posting */
- int x, int y, int entry) /* The root X,Y coordinates where the
+ int x, int y, int index) /* The root X,Y coordinates where the
* specified entry will be posted */
{
int vRootX, vRootY, vRootWidth, vRootHeight;
int result;
- if (entry >= menuPtr->numEntries) {
- entry = menuPtr->numEntries - 1;
+ if (index >= menuPtr->numEntries) {
+ index = menuPtr->numEntries - 1;
}
- if (entry >= 0) {
- y -= menuPtr->entries[entry]->y;
+ if (index >= 0) {
+ y -= menuPtr->entries[index]->y;
}
TkActivateMenuEntry(menuPtr, -1);