diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-18 12:47:38 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-18 12:47:38 (GMT) |
commit | 63d55485eb9be2e21c911bdc78e0367d8d7ecb2c (patch) | |
tree | 80450d56ce49849889e9233fac6643a3589623a0 /generic/tkMenu.c | |
parent | c6eb4388bed08a7f24b9de6cd12d1500cab024ca (diff) | |
download | tk-63d55485eb9be2e21c911bdc78e0367d8d7ecb2c.zip tk-63d55485eb9be2e21c911bdc78e0367d8d7ecb2c.tar.gz tk-63d55485eb9be2e21c911bdc78e0367d8d7ecb2c.tar.bz2 |
Missed more than a few TIP 660 changes. Possibly more to come.
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r-- | generic/tkMenu.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 5e2f381..3eaa86e 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -749,7 +749,7 @@ MenuWidgetObjCmd( first = 1; } - if ((first == TCL_INDEX_NONE) || (last < first)) { + if ((first < 0) || (last < first)) { goto done; } DeleteMenuCloneEntries(menuPtr, first, last); @@ -766,7 +766,7 @@ MenuWidgetObjCmd( if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } - if (index == TCL_INDEX_NONE) { + if (index < 0) { goto done; } mePtr = menuPtr->entries[index]; @@ -791,7 +791,7 @@ MenuWidgetObjCmd( if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } - if (index == TCL_INDEX_NONE) { + if (index < 0) { goto done; } mePtr = menuPtr->entries[index]; @@ -832,7 +832,7 @@ MenuWidgetObjCmd( goto error; } #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) - if (index == TCL_INDEX_NONE) { + if (index < 0) { Tcl_SetObjResult(interp, Tcl_NewObj()); } else #endif @@ -859,7 +859,7 @@ MenuWidgetObjCmd( if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } - if (index == TCL_INDEX_NONE) { + if (index < 0) { goto done; } result = TkInvokeMenu(interp, menuPtr, index); @@ -912,7 +912,7 @@ MenuWidgetObjCmd( if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } - if ((index == TCL_INDEX_NONE) || (menuPtr->entries[index]->type != CASCADE_ENTRY)) { + if ((index < 0) || (menuPtr->entries[index]->type != CASCADE_ENTRY)) { result = TkPostSubmenu(interp, menuPtr, NULL); } else { result = TkPostSubmenu(interp, menuPtr, menuPtr->entries[index]); @@ -930,7 +930,7 @@ MenuWidgetObjCmd( if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } - if (index == TCL_INDEX_NONE) { + if (index < 0) { goto done; } if (menuPtr->entries[index]->type == TEAROFF_ENTRY) { @@ -1001,7 +1001,7 @@ TkInvokeMenu( int result = TCL_OK; TkMenuEntry *mePtr; - if (index == TCL_INDEX_NONE) { + if (index < 0) { goto done; } mePtr = menuPtr->entries[index]; @@ -2351,7 +2351,7 @@ MenuAddOrInsert( } else { index = menuPtr->numEntries; } - if (index == TCL_INDEX_NONE) { + if (index < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad menu entry index \"%s\"", Tcl_GetString(indexPtr))); Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", NULL); @@ -2868,7 +2868,7 @@ MenuDoXPosition( return TCL_ERROR; } Tcl_ResetResult(interp); - if (index == TCL_INDEX_NONE) { + if (index < 0) { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0)); } else { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(menuPtr->entries[index]->x)); @@ -2905,7 +2905,7 @@ MenuDoYPosition( goto error; } Tcl_ResetResult(interp); - if (index == TCL_INDEX_NONE) { + if (index < 0) { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0)); } else { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(menuPtr->entries[index]->y)); |