summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r--generic/tkEntry.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 34f11d2..ff3f134 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1176,15 +1176,13 @@ ConfigureEntry(
if (entryPtr->type == TK_SPINBOX) {
if (sbPtr->fromValue > sbPtr->toValue) {
- /*
- * Swap -from and -to values.
- */
-
- double tmpFromTo = sbPtr->fromValue;
-
- sbPtr->fromValue = sbPtr->toValue;
- sbPtr->toValue = tmpFromTo;
- }
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "-to value must be greater than -from value",
+ -1));
+ Tcl_SetErrorCode(interp, "TK", "SPINBOX", "RANGE_SANITY",
+ NULL);
+ continue;
+ }
if (sbPtr->reqFormat && (oldFormat != sbPtr->reqFormat)) {
/*