summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkNotebook.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/ttk/ttkNotebook.c')
-rw-r--r--generic/ttk/ttkNotebook.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index dd757cb..81a8b64 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -727,9 +727,9 @@ static int AddTab(
}
#if 0 /* can't happen */
if (Ttk_SlaveIndex(nb->notebook.mgr, slaveWindow) >= 0) {
- Tcl_AppendResult(interp,
- Tk_PathName(slaveWindow), " already added",
- NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s already added",
+ Tk_PathName(slaveWindow)));
+ Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "PRESENT", NULL);
return TCL_ERROR;
}
#endif
@@ -859,10 +859,9 @@ static int GetTabIndex(
int status = FindTabIndex(interp, nb, objPtr, index_rtn);
if (status == TCL_OK && *index_rtn < 0) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp,
- "tab '", Tcl_GetString(objPtr), "' not found",
- NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "tab '%s' not found", Tcl_GetString(objPtr)));
+ Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "TAB", NULL);
status = TCL_ERROR;
}
return status;
@@ -1059,9 +1058,8 @@ static int NotebookIdentifyCommand(
if ( Tcl_GetIntFromObj(interp, objv[objc-2], &x) != TCL_OK
|| Tcl_GetIntFromObj(interp, objv[objc-1], &y) != TCL_OK
- || (objc == 5 &&
- Tcl_GetIndexFromObj(interp, objv[2], whatTable, "option", 0, &what)
- != TCL_OK)
+ || (objc == 5 && Tcl_GetIndexFromObjStruct(interp, objv[2], whatTable,
+ sizeof(char *), "option", 0, &what) != TCL_OK)
) {
return TCL_ERROR;
}
@@ -1082,7 +1080,8 @@ static int NotebookIdentifyCommand(
case IDENTIFY_ELEMENT:
if (element) {
const char *elementName = Ttk_ElementName(element);
- Tcl_SetObjResult(interp,Tcl_NewStringObj(elementName,-1));
+
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1));
}
break;
case IDENTIFY_TAB:
@@ -1173,10 +1172,10 @@ static int NotebookTabsCommand(
result = Tcl_NewListObj(0, NULL);
for (i = 0; i < Ttk_NumberSlaves(mgr); ++i) {
const char *pathName = Tk_PathName(Ttk_SlaveWindow(mgr,i));
- Tcl_ListObjAppendElement(interp, result, Tcl_NewStringObj(pathName,-1));
+
+ Tcl_ListObjAppendElement(NULL, result, Tcl_NewStringObj(pathName,-1));
}
Tcl_SetObjResult(interp, result);
-
return TCL_OK;
}