summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-03-08 21:56:11 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-03-08 21:56:11 (GMT)
commit42f14fb52f5a0cdf6113741ca6187d7d56fafa32 (patch)
tree79a38c0207d5138e80f149d603100beb30fdc85c /generic
parentd4e3294d3a4adb1370d84500401b26f7279119cc (diff)
parent23afeb02af6706ac255b77e35f2cc644d2c4e524 (diff)
downloadtk-42f14fb52f5a0cdf6113741ca6187d7d56fafa32.zip
tk-42f14fb52f5a0cdf6113741ca6187d7d56fafa32.tar.gz
tk-42f14fb52f5a0cdf6113741ca6187d7d56fafa32.tar.bz2
Rebased to core-8-6-branch
Diffstat (limited to 'generic')
-rw-r--r--generic/tkScale.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/tkScale.c b/generic/tkScale.c
index cc7c294..cbc5202 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -303,6 +303,12 @@ Tk_ScaleObjCmd(
return TCL_ERROR;
}
+ /*
+ * The widget was just created, no command callback must be invoked.
+ */
+
+ scalePtr->flags &= ~INVOKE_COMMAND;
+
Tcl_SetObjResult(interp, TkNewWindowObj(scalePtr->tkwin));
return TCL_OK;
}
@@ -1268,7 +1274,14 @@ TkScaleSetValue(
return;
}
scalePtr->value = value;
- if (invokeCommand) {
+
+ /*
+ * Schedule command callback invocation only if there is such a command
+ * already registered, otherwise the callback would trigger later when
+ * configuring the widget -command option even if the value did not change.
+ */
+
+ if ((invokeCommand) && (scalePtr->command != NULL)) {
scalePtr->flags |= INVOKE_COMMAND;
}
TkEventuallyRedrawScale(scalePtr, REDRAW_SLIDER);