diff options
author | hobbs <hobbs> | 2002-04-23 00:48:29 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-04-23 00:48:29 (GMT) |
commit | 30329416a3c01e9ac098a93f793bced1dfb8f2f9 (patch) | |
tree | 65e8fb6fc2e3c142e53173445fe5d1bedaf2886b /library/button.tcl | |
parent | e2e0d8545161567ae0678b10c3b6e3e7625a7319 (diff) | |
download | tk-30329416a3c01e9ac098a93f793bced1dfb8f2f9.zip tk-30329416a3c01e9ac098a93f793bced1dfb8f2f9.tar.gz tk-30329416a3c01e9ac098a93f793bced1dfb8f2f9.tar.bz2 |
* library/button.tcl (ButtonLeave): corrected the 3
implementations of ButtonLeave to check for Priv(relief) existing
before trying to use it. [Patch #541849]
Diffstat (limited to 'library/button.tcl')
-rw-r--r-- | library/button.tcl | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/library/button.tcl b/library/button.tcl index fe32659..ef14f71 100644 --- a/library/button.tcl +++ b/library/button.tcl @@ -4,7 +4,7 @@ # checkbutton, and radiobutton widgets and provides procedures # that help in implementing those bindings. # -# RCS: @(#) $Id: button.tcl,v 1.12 2001/11/23 02:04:08 das Exp $ +# RCS: @(#) $Id: button.tcl,v 1.13 2002/04/23 00:48:29 hobbs Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -149,7 +149,7 @@ proc ::tk::ButtonEnter w { if {[string equal $Priv(buttonWindow) $w]} { $w configure -state active -relief sunken - } elseif { [string compare [$w cget -overrelief] ""] } { + } elseif {[$w cget -overrelief] ne ""} { set Priv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } @@ -176,8 +176,8 @@ proc ::tk::ButtonLeave w { # Restore the original button relief if the mouse button is down # or there is an -overrelief value. - if {[string equal $Priv(buttonWindow) $w] || \ - [string compare [$w cget -overrelief] ""] } { + if {[info exists Priv(relief)] && (($Priv(buttonWindow) eq $w) || \ + ([$w cget -overrelief] ne ""))} { $w configure -relief $Priv(relief) } @@ -327,7 +327,7 @@ proc ::tk::ButtonEnter {w} { if {[string equal $Priv(buttonWindow) $w]} { $w configure -state active -relief sunken - } elseif { [string compare [$w cget -overrelief] ""] } { + } elseif {[$w cget -overrelief] ne ""} { set Priv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } @@ -351,12 +351,12 @@ proc ::tk::ButtonLeave w { if {[string compare [$w cget -state] "disabled"]} { $w configure -state normal } - + # Restore the original button relief if the mouse button is down # or there is an -overrelief value. - if {[string equal $Priv(buttonWindow) $w] || \ - [string compare [$w cget -overrelief] ""] } { + if {[info exists Priv(relief)] && (($Priv(buttonWindow) eq $w) || \ + ([$w cget -overrelief] ne ""))} { $w configure -relief $Priv(relief) } @@ -457,7 +457,7 @@ proc ::tk::ButtonEnter {w} { if {[string compare [$w cget -state] "disabled"]} { if {[string equal $w $Priv(buttonWindow)]} { $w configure -state active - } elseif { [string compare [$w cget -overrelief] ""] } { + } elseif {[$w cget -overrelief] ne ""} { set Priv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } @@ -480,7 +480,8 @@ proc ::tk::ButtonLeave w { if {[string equal $w $Priv(buttonWindow)]} { $w configure -state normal } - if { [string compare [$w cget -overrelief] ""] } { + if {[info exists Priv(relief)] && (($Priv(buttonWindow) eq $w) || \ + ([$w cget -overrelief] ne ""))} { $w configure -relief $Priv(relief) } set Priv(window) "" |