diff options
author | fvogel <fvogelnew1@free.fr> | 2016-05-20 15:43:02 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-05-20 15:43:02 (GMT) |
commit | 0529352ef03d575aa2df3317cd1e3145209c5292 (patch) | |
tree | 8b543030b85167824d0f31f1c0d3ce71a9782f92 /library | |
parent | 1a64042e82238940c820745c5057df95c98e1c5d (diff) | |
parent | 2f150c8d18e576998e9d30ac08c562a1365b3051 (diff) | |
download | tk-0529352ef03d575aa2df3317cd1e3145209c5292.zip tk-0529352ef03d575aa2df3317cd1e3145209c5292.tar.gz tk-0529352ef03d575aa2df3317cd1e3145209c5292.tar.bz2 |
Merged core-8-6-branchmultiscreens
Diffstat (limited to 'library')
-rw-r--r-- | library/button.tcl | 19 | ||||
-rw-r--r-- | library/scrlbar.tcl | 11 |
2 files changed, 24 insertions, 6 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] } diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index b7be014..6f1caa2 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -430,6 +430,9 @@ proc ::tk::ScrollTopBottom {w x y} { proc ::tk::ScrollButton2Down {w x y} { variable ::tk::Priv + if {![winfo exists $w]} { + return + } set element [$w identify $x $y] if {[string match {arrow[12]} $element]} { ScrollButtonDown $w $x $y @@ -443,7 +446,9 @@ proc ::tk::ScrollButton2Down {w x y} { # slider drag. update idletasks - $w configure -activerelief sunken - $w activate slider - ScrollStartDrag $w $x $y + if {[winfo exists $w]} { + $w configure -activerelief sunken + $w activate slider + ScrollStartDrag $w $x $y + } } |