summaryrefslogtreecommitdiffstats
path: root/generic
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)
commite353dfd7b77de377b5475b760d286a0990958dd6 (patch)
tree039efe1806ca6290bb2cc672030b093b35f9edad /generic
parent612675a4f57c40b222eccf363977705fbdd848aa (diff)
downloadtk-e353dfd7b77de377b5475b760d286a0990958dd6.zip
tk-e353dfd7b77de377b5475b760d286a0990958dd6.tar.gz
tk-e353dfd7b77de377b5475b760d286a0990958dd6.tar.bz2
Fixed bug [841280] - spinbox -from and -to defaults and behaviourbug_841280ffff
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)) {
/*