diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-10-25 21:06:25 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-10-25 21:06:25 (GMT) |
| commit | 0d5336db012f45753abace489f18f0ca299c6961 (patch) | |
| tree | b1bf3280a9046df99226158978502eeb26f5b0a3 /generic/tkMenu.c | |
| parent | e97381a6d921de403516d5b761539a450f4af83c (diff) | |
| parent | 1320b8a2a9c1269a345d44d673a7a35707fbbe9c (diff) | |
| download | tk-core-tip-626.zip tk-core-tip-626.tar.gz tk-core-tip-626.tar.bz2 | |
Merge 9.0core-tip-626
Diffstat (limited to 'generic/tkMenu.c')
| -rw-r--r-- | generic/tkMenu.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c index dafb1e9..9066e68 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -249,8 +249,8 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { offsetof(TkMenu, activeFgPtr), TCL_INDEX_NONE, 0, DEF_MENU_ACTIVE_FG_MONO, 0}, {TK_OPTION_RELIEF, "-activerelief", "activeRelief", "Relief", - DEF_MENU_ACTIVE_RELIEF, offsetof(TkMenu, activeReliefPtr), - TCL_INDEX_NONE, 0, NULL, 0}, + DEF_MENU_ACTIVE_RELIEF, TCL_INDEX_NONE, + offsetof(TkMenu, activeRelief), 0, NULL, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), TCL_INDEX_NONE, 0, DEF_MENU_BG_MONO, 0}, @@ -260,7 +260,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MENU_BORDER_WIDTH, - offsetof(TkMenu, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, + offsetof(TkMenu, borderWidthObj), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_MENU_CURSOR, offsetof(TkMenu, cursorPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, @@ -1008,7 +1008,7 @@ MenuWidgetObjCmd( * * Side effects: * Commands may get excecuted; variables may get set; sub-menus may get - * posted. + * posted, the passed menu may be destroyed. * *---------------------------------------------------------------------- */ @@ -1017,8 +1017,12 @@ int TkInvokeMenu( Tcl_Interp *interp, /* The interp that the menu lives in. */ TkMenu *menuPtr, /* The menu we are invoking. */ - Tcl_Size index) /* The zero based index of the item we are - * invoking. */ + /* Must be protected by Tcl_Preserve + * against freeing by the caller. + * Tk Bug [2d3a81c0]. + */ + Tcl_Size index) /* The zero based index of the item we are + * invoking. */ { int result = TCL_OK; TkMenuEntry *mePtr; @@ -3039,7 +3043,7 @@ GetIndexFromCoords( TkRecomputeMenu(menuPtr); p = string + 1; Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, - menuPtr->borderWidthPtr, &borderwidth); + menuPtr->borderWidthObj, &borderwidth); rest = strchr(p, ','); if (rest) { Tcl_DString ds; |
