diff options
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) "" |