summaryrefslogtreecommitdiffstats
path: root/carbon/tkMacOSXEmbed.c
diff options
context:
space:
mode:
Diffstat (limited to 'carbon/tkMacOSXEmbed.c')
-rw-r--r--carbon/tkMacOSXEmbed.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/carbon/tkMacOSXEmbed.c b/carbon/tkMacOSXEmbed.c
index ad9e3da..39e9aaa 100644
--- a/carbon/tkMacOSXEmbed.c
+++ b/carbon/tkMacOSXEmbed.c
@@ -208,8 +208,9 @@ TkpUseWindow(
Container *containerPtr;
if (winPtr->window != None) {
- Tcl_AppendResult(interp, "can't modify container after widget is "
- "created", NULL);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "can't modify container after widget is created", -1));
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "POST_CREATE", NULL);
return TCL_ERROR;
}
@@ -227,12 +228,12 @@ TkpUseWindow(
}
usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, (Window) parent);
- if (usePtr != NULL) {
- if (!(usePtr->flags & TK_CONTAINER)) {
- Tcl_AppendResult(interp, "window \"", usePtr->pathName,
- "\" doesn't have -container option set", NULL);
- return TCL_ERROR;
- }
+ if (usePtr != NULL && !(usePtr->flags & TK_CONTAINER)) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "window \"%s\" doesn't have -container option set",
+ usePtr->pathName));
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "CONTAINER", NULL);
+ return TCL_ERROR;
}
/*
@@ -312,8 +313,10 @@ TkpUseWindow(
if (tkMacOSXEmbedHandler == NULL ||
tkMacOSXEmbedHandler->registerWinProc((int) parent,
(Tk_Window) winPtr) != TCL_OK) {
- Tcl_AppendResult(interp, "The window ID ", string,
- " does not correspond to a valid Tk Window.", NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "The window ID %s does not correspond to a valid Tk Window",
+ string));
+ Tcl_SetErrorCode(interp, "TK", "EMBED", "HANDLE", NULL);
return TCL_ERROR;
} else {
containerPtr = ckalloc(sizeof(Container));