summaryrefslogtreecommitdiffstats
path: root/library/button.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-05-03 11:58:19 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-05-03 11:58:19 (GMT)
commit7d9b01a703f0399154c77bc601a9fca02e442a7e (patch)
tree4efbc37637e2a4891fb6045657552a485e39be0c /library/button.tcl
parentf029cdefba0b76dc5ae8014a6f01a2a71dfe534c (diff)
downloadtk-7d9b01a703f0399154c77bc601a9fca02e442a7e.zip
tk-7d9b01a703f0399154c77bc601a9fca02e442a7e.tar.gz
tk-7d9b01a703f0399154c77bc601a9fca02e442a7e.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.tcl6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/button.tcl b/library/button.tcl
index a977c49..4b35281 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.20 2009/10/24 00:01:48 dkf Exp $
+# RCS: @(#) $Id: button.tcl,v 1.21 2010/05/03 11:59:11 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