summaryrefslogtreecommitdiffstats
path: root/library/palette.tcl
diff options
context:
space:
mode:
authordas <das@noemail.net>2007-05-09 12:56:31 (GMT)
committerdas <das@noemail.net>2007-05-09 12:56:31 (GMT)
commitfb2d1cc07861b2952ad97867cbc7067d804cc0f4 (patch)
tree364c9e8eb492cda72c1c4018b36f38967f169c17 /library/palette.tcl
parentd605da88bba990304b780160b9a8a8fd587b65dc (diff)
downloadtk-fb2d1cc07861b2952ad97867cbc7067d804cc0f4.zip
tk-fb2d1cc07861b2952ad97867cbc7067d804cc0f4.tar.gz
tk-fb2d1cc07861b2952ad97867cbc7067d804cc0f4.tar.bz2
* library/palette.tcl (tk::RecolorTree): handle color options with
empty value, fixes error due to emtpy -selectforeground (reported on tcl-mac by Russel E. Owen). FossilOrigin-Name: c7e97217aa361b600f299d48fc65ea5f12e24327
Diffstat (limited to 'library/palette.tcl')
-rw-r--r--library/palette.tcl12
1 files changed, 8 insertions, 4 deletions
diff --git a/library/palette.tcl b/library/palette.tcl
index c53fad5..b294abc 100644
--- a/library/palette.tcl
+++ b/library/palette.tcl
@@ -3,7 +3,7 @@
# This file contains procedures that change the color palette used
# by Tk.
#
-# RCS: @(#) $Id: palette.tcl,v 1.8.2.2 2006/03/17 10:50:11 patthoyts Exp $
+# RCS: @(#) $Id: palette.tcl,v 1.8.2.3 2007/05/09 12:56:32 das Exp $
#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
#
@@ -181,11 +181,15 @@ proc ::tk::RecolorTree {w colors} {
if {[string match {} $defaultcolor] || \
([info exists prototype] && \
[$prototype cget $option] ne "$defaultcolor")} {
- set defaultcolor [winfo rgb . [lindex $value 3]]
- } else {
+ set defaultcolor [lindex $value 3]
+ }
+ if {![string match {} $defaultcolor]} {
set defaultcolor [winfo rgb . $defaultcolor]
}
- set chosencolor [winfo rgb . [lindex $value 4]]
+ set chosencolor [lindex $value 4]
+ if {![string match {} $chosencolor]} {
+ set chosencolor [winfo rgb . $chosencolor]
+ }
if {[string match $defaultcolor $chosencolor]} {
# Change the option database so that future windows will get
# the same colors.