diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2010-05-03 12:06:13 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2010-05-03 12:06:13 (GMT) |
commit | acbf3eb1a82fc50625218b174d1fb42bbc5c5596 (patch) | |
tree | cb35a6dd06a01a56bda46a495c0c67daa2260ff0 /library/button.tcl | |
parent | dc1a97a60a5eb33bbfc2c54824ce9d4cb50078db (diff) | |
download | tk-acbf3eb1a82fc50625218b174d1fb42bbc5c5596.zip tk-acbf3eb1a82fc50625218b174d1fb42bbc5c5596.tar.gz tk-acbf3eb1a82fc50625218b174d1fb42bbc5c5596.tar.bz2 |
* library/button.tcl (CheckInvoke, CheckEnter): [Patch 1530276 redux]:
Apply a bit more care to ensure that things continue to work correctly
even when there is no -selectcolor defined.
Diffstat (limited to 'library/button.tcl')
-rw-r--r-- | library/button.tcl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/button.tcl b/library/button.tcl index 0d493fb..6560dc1 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.19.4.1 2009/10/24 00:12:03 dkf Exp $ +# RCS: @(#) $Id: button.tcl,v 1.19.4.2 2010/05/03 12:06:14 dkf Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -659,7 +659,7 @@ proc ::tk::CheckInvoke {w} { # Additional logic to switch the "selected" colors around if necessary # (when we're indicator-less). - if {![$w cget -indicatoron]} { + if {![$w cget -indicatoron] && [info exist Priv($w,selectcolor)]} { if {[$w cget -selectcolor] eq $Priv($w,aselectcolor)} { $w configure -selectcolor $Priv($w,selectcolor) } else { @@ -697,7 +697,7 @@ proc ::tk::CheckEnter {w} { # Compute what the "selected and active" color should be. - if {![$w cget -indicatoron]} { + if {![$w cget -indicatoron] && [$w cget -selectcolor] ne ""} { set Priv($w,selectcolor) [$w cget -selectcolor] lassign [winfo rgb $w [$w cget -selectcolor]] r1 g1 b1 lassign [winfo rgb $w [$w cget -activebackground]] r2 g2 b2 |