summaryrefslogtreecommitdiffstats
path: root/tests/ttk
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@noemail.net>2011-03-19 02:00:40 (GMT)
committerpatthoyts <patthoyts@noemail.net>2011-03-19 02:00:40 (GMT)
commit6bc69f25be173b45433fedf824047a8900f80183 (patch)
tree79c19473af43ce7fc7b827964122072262185961 /tests/ttk
parentb6144dc732e01147645205d69851a8ef54071252 (diff)
downloadtk-6bc69f25be173b45433fedf824047a8900f80183.zip
tk-6bc69f25be173b45433fedf824047a8900f80183.tar.gz
tk-6bc69f25be173b45433fedf824047a8900f80183.tar.bz2
[Bug 3223850] - button remains stuck when disabled as depressed on XP
If a button is disabled while the state is pressed, then the release event handler did not remove the pressed state. Modified the handler to always remove the pressed state while only calling invoke if !disabled. Reported-by: Thomas MENEZ <thomasmenez@users.sourceforge.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> FossilOrigin-Name: 3837f9f2914fe138a0fee1ff6ef295cbb16d614b
Diffstat (limited to 'tests/ttk')
-rw-r--r--tests/ttk/ttk.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index 9732f46..ddfaf84 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -197,6 +197,23 @@ test ttk-2.7 "instate scripts, true" -body {
set x
} -result 1
+test ttk-2.8 "bug 3223850: button state disabled during click" -setup {
+ destroy .b
+ set ttk28 {}
+ pack [ttk::button .b -command {set ::ttk28 failed}]
+} -body {
+ bind .b <ButtonPress-1> {after 0 {.b configure -state disabled}}
+ after 1 {event generate .b <ButtonPress-1>}
+ after 20 {event generate .b <ButtonRelease-1>}
+ set aid [after 100 {set ::ttk28 [.b instate {disabled !pressed}]}]
+ vwait ::ttk28
+ after cancel $aid
+ set ttk28
+} -cleanup {
+ destroy .b
+ unset -nocomplain ttk28 aid
+} -result 1
+
# misc. error detection
test ttk-3.0 "Bad option" -body {
ttk::button .bad -badoption foo