summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2016-02-25 14:40:12 (GMT)
committerfvogelnew1@free.fr <fvogel>2016-02-25 14:40:12 (GMT)
commit89b129671fd0ca6e6e67cbdee645e92e3e36b15f (patch)
tree039efe1806ca6290bb2cc672030b093b35f9edad /generic
parent90888a5d3218a161dae936b54b271eed2b948248 (diff)
downloadtk-89b129671fd0ca6e6e67cbdee645e92e3e36b15f.zip
tk-89b129671fd0ca6e6e67cbdee645e92e3e36b15f.tar.gz
tk-89b129671fd0ca6e6e67cbdee645e92e3e36b15f.tar.bz2
Fixed bug [841280] - spinbox -from and -to defaults and behaviour
Diffstat (limited to 'generic')
-rw-r--r--generic/tkEntry.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index ea8d7f1..5681e47 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1176,13 +1176,15 @@ ConfigureEntry(
if (entryPtr->type == TK_SPINBOX) {
if (sbPtr->fromValue > sbPtr->toValue) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "-to value must be greater than -from value",
- -1));
- Tcl_SetErrorCode(interp, "TK", "SPINBOX", "RANGE_SANITY",
- NULL);
- continue;
- }
+ /*
+ * Swap -from and -to values.
+ */
+
+ double tmpFromTo = sbPtr->fromValue;
+
+ sbPtr->fromValue = sbPtr->toValue;
+ sbPtr->toValue = tmpFromTo;
+ }
if (sbPtr->reqFormat && (oldFormat != sbPtr->reqFormat)) {
/*