diff options
author | das <das@noemail.net> | 2007-05-09 12:51:55 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2007-05-09 12:51:55 (GMT) |
commit | 0131f5ff02608b2828a779b112c035de42cc82e0 (patch) | |
tree | 56a8a687245e49e85dd8bee5e6218fe7778e058e /library/palette.tcl | |
parent | ecee36240b15d7c2c309d98fd67fdb4d687532c2 (diff) | |
download | tk-0131f5ff02608b2828a779b112c035de42cc82e0.zip tk-0131f5ff02608b2828a779b112c035de42cc82e0.tar.gz tk-0131f5ff02608b2828a779b112c035de42cc82e0.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: 1719fc7c071d1e073af9ffdeaeefb1f5a1db1ce2
Diffstat (limited to 'library/palette.tcl')
-rw-r--r-- | library/palette.tcl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/library/palette.tcl b/library/palette.tcl index 323d372..eae93d9 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.11 2006/03/17 11:13:15 patthoyts Exp $ +# RCS: @(#) $Id: palette.tcl,v 1.12 2007/05/09 12:51:55 das Exp $ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # @@ -179,11 +179,15 @@ proc ::tk::RecolorTree {w colors} { if {$defaultcolor eq "" || \ ([info exists prototype] && \ [$prototype cget $option] ne "$defaultcolor")} { - set defaultcolor [winfo rgb . [lindex $value 3]] - } else { + set defaultcolor [lindex $value 3] + } + if {$defaultcolor ne ""} { set defaultcolor [winfo rgb . $defaultcolor] } - set chosencolor [winfo rgb . [lindex $value 4]] + set chosencolor [lindex $value 4] + if {$chosencolor ne ""} { + set chosencolor [winfo rgb . $chosencolor] + } if {[string match $defaultcolor $chosencolor]} { # Change the option database so that future windows will get # the same colors. |