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 | 51e7b72add3bf5d52641ece6acf15ad1225cc84f (patch) | |
tree | cb35a6dd06a01a56bda46a495c0c67daa2260ff0 /library | |
parent | d03d118bc7e24f63ebe7cdbca69cb4da43089d5d (diff) | |
download | tk-51e7b72add3bf5d52641ece6acf15ad1225cc84f.zip tk-51e7b72add3bf5d52641ece6acf15ad1225cc84f.tar.gz tk-51e7b72add3bf5d52641ece6acf15ad1225cc84f.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')
-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 |