summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorculler <culler>2019-01-11 21:47:27 (GMT)
committerculler <culler>2019-01-11 21:47:27 (GMT)
commitda7c298f108280140fbbec81f67705f684bf5fe6 (patch)
tree74cb6130471b57b3663cec8d929c8786c922388f /unix
parentd155557faa7d1e039c912fc21ffccaf160c26b8e (diff)
downloadtk-da7c298f108280140fbbec81f67705f684bf5fe6.zip
tk-da7c298f108280140fbbec81f67705f684bf5fe6.tar.gz
tk-da7c298f108280140fbbec81f67705f684bf5fe6.tar.bz2
Fix related menubutton issues on linux and Windows.
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixMenu.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index 38b6c58..f701819 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -889,7 +889,10 @@ DrawMenuUnderline(
*
* TkpPostMenu --
*
- * Posts a menu on the screen
+ * Posts a 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 itself is placed at the point.
*
* Results:
* None.
@@ -904,8 +907,14 @@ int
TkpPostMenu(
Tcl_Interp *interp,
TkMenu *menuPtr,
- int x, int y)
+ int x, int y, int entry)
{
+ if (entry >= menuPtr->numEntries) {
+ entry = menuPtr->numEntries - 1;
+ }
+ if (entry >= 0) {
+ y -= menuPtr->entries[entry]->y;
+ }
return TkPostTearoffMenu(interp, menuPtr, x, y);
}
@@ -1721,7 +1730,6 @@ TkpComputeStandardMenuGeometry(
}
windowWidth = x + indicatorSpace + labelWidth + accelWidth
+ 2 * activeBorderWidth + borderWidth;
-
windowHeight += borderWidth;
/*