summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-02-25 14:40:12 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-02-25 14:40:12 (GMT)
commit22a09fa099a33900fca7c81d9ac4880b3d861b80 (patch)
tree039efe1806ca6290bb2cc672030b093b35f9edad /generic/tkEntry.c
parentcb291a70f79d29466e600287a1a1d6fe89db0408 (diff)
downloadtk-22a09fa099a33900fca7c81d9ac4880b3d861b80.zip
tk-22a09fa099a33900fca7c81d9ac4880b3d861b80.tar.gz
tk-22a09fa099a33900fca7c81d9ac4880b3d861b80.tar.bz2
Fixed bug [841280] - spinbox -from and -to defaults and behaviour
Diffstat (limited to 'generic/tkEntry.c')
-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)) {
/*