summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2015-11-08 20:50:24 (GMT)
committerfvogelnew1@free.fr <fvogel>2015-11-08 20:50:24 (GMT)
commitfa4526c736eef6a43dc6bf1f004207e742107fca (patch)
tree48d4dad3ca5c0e6207d8dd378de1409ca4d1942f /generic
parent80baa955ca3df9272cfbb5fce17fe23c67f93e8c (diff)
parent5f02a99fac9654a023e9b3e909c48a9cbee3382f (diff)
downloadtk-fa4526c736eef6a43dc6bf1f004207e742107fca.zip
tk-fa4526c736eef6a43dc6bf1f004207e742107fca.tar.gz
tk-fa4526c736eef6a43dc6bf1f004207e742107fca.tar.bz2
Fixed [2160206fff] - Panic when posting a menu of type menubar
Diffstat (limited to 'generic')
-rw-r--r--generic/tkMenu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 49b5935..b35be24 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -934,9 +934,14 @@ MenuWidgetObjCmd(
* Tearoff menus are posted differently on Mac and Windows than
* non-tearoffs. TkpPostMenu does not actually map the menu's window
* on those platforms, and popup menus have to be handled specially.
+ * Also, menubar menues are not intended to be posted (bug 1567681,
+ * 2160206).
*/
- if (menuPtr->menuType != TEAROFF_MENU) {
+ if (menuPtr->menuType == MENUBAR) {
+ 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);
} else {
result = TkPostTearoffMenu(interp, menuPtr, x, y);