summaryrefslogtreecommitdiffstats
path: root/library/button.tcl
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-05-20 15:43:02 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-05-20 15:43:02 (GMT)
commit0529352ef03d575aa2df3317cd1e3145209c5292 (patch)
tree8b543030b85167824d0f31f1c0d3ce71a9782f92 /library/button.tcl
parent1a64042e82238940c820745c5057df95c98e1c5d (diff)
parent2f150c8d18e576998e9d30ac08c562a1365b3051 (diff)
downloadtk-multiscreens.zip
tk-multiscreens.tar.gz
tk-multiscreens.tar.bz2
Merged core-8-6-branchmultiscreens
Diffstat (limited to 'library/button.tcl')
-rw-r--r--library/button.tcl19
1 files changed, 16 insertions, 3 deletions
diff --git a/library/button.tcl b/library/button.tcl
index b2bafb2..80d8bf9 100644
--- a/library/button.tcl
+++ b/library/button.tcl
@@ -597,12 +597,25 @@ proc ::tk::ButtonUp w {
# w - The name of the widget.
proc ::tk::ButtonInvoke w {
- if {[$w cget -state] ne "disabled"} {
+ if {[winfo exists $w] && [$w cget -state] ne "disabled"} {
set oldRelief [$w cget -relief]
set oldState [$w cget -state]
$w configure -state active -relief sunken
- update idletasks
- after 100
+ 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]
}