summaryrefslogtreecommitdiffstats
path: root/generic/tkListbox.c
diff options
context:
space:
mode:
authorericm <ericm>1999-11-18 02:24:41 (GMT)
committerericm <ericm>1999-11-18 02:24:41 (GMT)
commita5402ae646644c2199d06862f3b0e70257c6fb3a (patch)
treeec2f0d56df29f9a5eb0db051a7ff1248a74528d3 /generic/tkListbox.c
parent5beebee053db6f96bc2d8a15a80ec73fc7aef8b5 (diff)
downloadtk-a5402ae646644c2199d06862f3b0e70257c6fb3a.zip
tk-a5402ae646644c2199d06862f3b0e70257c6fb3a.tar.gz
tk-a5402ae646644c2199d06862f3b0e70257c6fb3a.tar.bz2
* tests/listbox.test: Updated tests for new error messages.
* generic/tkListbox.c: Improved error messages for bad -listvar's.
Diffstat (limited to 'generic/tkListbox.c')
-rw-r--r--generic/tkListbox.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index 36dbf76..913757c 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkListbox.c,v 1.8 1999/11/18 01:47:07 ericm Exp $
+ * RCS: @(#) $Id: tkListbox.c,v 1.9 1999/11/18 02:24:41 ericm Exp $
*/
#include "tkPort.h"
@@ -1336,6 +1336,8 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
/* Make sure the object is a good list object */
if (Tcl_ListObjLength(listPtr->interp, listVarObj, &dummy) != TCL_OK) {
Tk_RestoreSavedOptions(&savedOptions);
+ Tcl_AppendResult(listPtr->interp, ": invalid listvar value",
+ (char *)NULL);
return TCL_ERROR;
}
@@ -2822,12 +2824,12 @@ ListboxListVarProc(clientData, interp, name1, name2, flags)
/*
* Make sure the new value is a good list; if it's not, disallow
* the change -- the fact that it is a listvar means that it must
- * always be a valid list
+ * always be a valid list -- and return an error message.
*/
if (Tcl_ListObjLength(listPtr->interp, varListObj, &i) != TCL_OK) {
Tcl_SetVar2Ex(interp, listPtr->listVarName, (char *)NULL,
oldListObj, TCL_GLOBAL_ONLY);
- varListObj = oldListObj;
+ return("invalid listvar value");
}
listPtr->listObj = varListObj;