diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkMenu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c index d3551f9..eacdffb 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -856,12 +856,15 @@ MenuWidgetObjCmd( if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } -#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) if (index < 0) { +#if defined(TK_NO_DEPRECATED) Tcl_SetObjResult(interp, Tcl_NewObj()); - } else +#else + Tcl_SetObjResult(interp, Tcl_NewStringObj("none", TCL_INDEX_NONE)); #endif - Tcl_SetObjResult(interp, TkNewIndexObj(index)); + } else { + Tcl_SetObjResult(interp, TkNewIndexObj(index)); + } break; } case MENU_INSERT: |