summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2016-05-03 08:00:32 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2016-05-03 08:00:32 (GMT)
commit16b13f2ec108d0c8b9931ba0368211fccb6520f6 (patch)
treec0830a6a3eb0bed28895c61139b30b1d0943848b /library
parent86266ad172ab2444d1b8e70ff2330aa387ed75cd (diff)
parentba0b4077e063f417a12becc89c26ce31f9e30965 (diff)
downloadtk-16b13f2ec108d0c8b9931ba0368211fccb6520f6.zip
tk-16b13f2ec108d0c8b9931ba0368211fccb6520f6.tar.gz
tk-16b13f2ec108d0c8b9931ba0368211fccb6520f6.tar.bz2
Use non-busy wait in stead of busy "after 100". Testcase still passes! Great!
FossilOrigin-Name: b44ff3c9a2bbfc2da53cf8a0bce75bc86c5ece6c
Diffstat (limited to 'library')
-rw-r--r--library/button.tcl23
1 files changed, 17 insertions, 6 deletions
diff --git a/library/button.tcl b/library/button.tcl
index 16624e7..80d8bf9 100644
--- a/library/button.tcl
+++ b/library/button.tcl
@@ -601,12 +601,23 @@ proc ::tk::ButtonInvoke w {
set oldRelief [$w cget -relief]
set oldState [$w cget -state]
$w configure -state active -relief sunken
- update idletasks
- after 100
- if {[winfo exists $w]} {
- $w configure -state $oldState -relief $oldRelief
- uplevel #0 [list $w invoke]
- }
+ after 100 [list ::tk::ButtonInvokeEnd $w $oldState $oldRelief]
+ }
+}
+
+# ::tk::ButtonInvokeEnd --
+# The procedure below is called after a button is invoked through
+# the keyboard. It simulate a release of the button via the mouse.
+#
+# Arguments:
+# w - The name of the widget.
+# oldState - Old state to be set back.
+# oldRelief - Old relief to be set back.
+
+proc ::tk::ButtonInvokeEnd {w oldState oldRelief} {
+ if {[winfo exists $w]} {
+ $w configure -state $oldState -relief $oldRelief
+ uplevel #0 [list $w invoke]
}
}