summaryrefslogtreecommitdiffstats
path: root/generic/tkClipboard.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-07-23 13:59:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-07-23 13:59:40 (GMT)
commit571fd220b0be2da05b1a6e8bb32e0b9a447ed288 (patch)
tree46a3064598e4a36c7ca561f9c08f5d22de4b2b9e /generic/tkClipboard.c
parented7fb54396eee6e5122bfe611b2a14cf422970fa (diff)
downloadtk-571fd220b0be2da05b1a6e8bb32e0b9a447ed288.zip
tk-571fd220b0be2da05b1a6e8bb32e0b9a447ed288.tar.gz
tk-571fd220b0be2da05b1a6e8bb32e0b9a447ed288.tar.bz2
Much more cleaning up of result handling.
Diffstat (limited to 'generic/tkClipboard.c')
-rw-r--r--generic/tkClipboard.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c
index e153064..94e8d7c 100644
--- a/generic/tkClipboard.c
+++ b/generic/tkClipboard.c
@@ -367,10 +367,12 @@ Tk_ClipboardAppend(
Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
type, ClipboardHandler, targetPtr, format);
} else if (targetPtr->format != format) {
- Tcl_AppendResult(interp, "format \"", Tk_GetAtomName(tkwin, format),
- "\" does not match current format \"",
- Tk_GetAtomName(tkwin, targetPtr->format),"\" for ",
- Tk_GetAtomName(tkwin, type), NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "format \"%s\" does not match current format \"%s\" for %s",
+ Tk_GetAtomName(tkwin, format),
+ Tk_GetAtomName(tkwin, targetPtr->format),
+ Tk_GetAtomName(tkwin, type)));
+ Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "FORMAT_MISMATCH", NULL);
return TCL_ERROR;
}
@@ -474,8 +476,9 @@ Tk_ClipboardObjCmd(
i++;
if (i >= objc) {
- Tcl_AppendResult(interp, "value for \"", string,
- "\" missing", NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "value for \"%s\" missing", string));
+ Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "VALUE", NULL);
return TCL_ERROR;
}
switch ((enum appendOptions) subIndex) {
@@ -563,8 +566,9 @@ Tk_ClipboardObjCmd(
}
i++;
if (i >= objc) {
- Tcl_AppendResult(interp, "value for \"", string,
- "\" missing", NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "value for \"%s\" missing", string));
+ Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "VALUE", NULL);
return TCL_ERROR;
}
switch ((enum getOptions) subIndex) {
@@ -702,12 +706,11 @@ ClipboardGetProc(
* selection. */
Tcl_Interp *interp, /* Interpreter used for error reporting (not
* used). */
- const char *portion) /* New information to be appended. */
+ const char *portion) /* New information to be appended. */
{
Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1);
return TCL_OK;
}
-
/*
* Local Variables: