diff options
author | culler <culler> | 2019-01-15 14:00:45 (GMT) |
---|---|---|
committer | culler <culler> | 2019-01-15 14:00:45 (GMT) |
commit | 4330a830cd514bf17caac0cfe5b29fef47022df7 (patch) | |
tree | 668c9ed0e4c7ac335ebabf300ddbd8dbc5e186c1 /win/tkWinMenu.c | |
parent | fe7e4b1e7f825147345d7e42707be7d53b72c904 (diff) | |
download | tk-4330a830cd514bf17caac0cfe5b29fef47022df7.zip tk-4330a830cd514bf17caac0cfe5b29fef47022df7.tar.gz tk-4330a830cd514bf17caac0cfe5b29fef47022df7.tar.bz2 |
Use TkGetMenuIndex to parse the index argument to the post command.
Diffstat (limited to 'win/tkWinMenu.c')
-rw-r--r-- | win/tkWinMenu.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index f1ac9b7..af127bf 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -761,7 +761,7 @@ int TkpPostMenu( Tcl_Interp *interp, TkMenu *menuPtr, - int x, int y, int entry) + int x, int y, int index) { HMENU winMenuHdl = (HMENU) menuPtr->platformData; int result, flags; @@ -781,11 +781,11 @@ TkpPostMenu( return 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; } /* @@ -854,7 +854,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. Adjusts the menu's position so that it * fits on the screen, and maps and raises the menu. * @@ -871,17 +871,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 we are + int x, int y, int index) /* The root X,Y coordinates where we are * posting */ { 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); |