diff options
Diffstat (limited to 'library/clrpick.tcl')
-rw-r--r-- | library/clrpick.tcl | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/library/clrpick.tcl b/library/clrpick.tcl index bf46be0..0dac803 100644 --- a/library/clrpick.tcl +++ b/library/clrpick.tcl @@ -3,7 +3,7 @@ # Color selection dialog for platforms that do not support a # standard color selection dialog. # -# RCS: @(#) $Id: clrpick.tcl,v 1.9 2000/03/02 03:10:01 ericm Exp $ +# RCS: @(#) $Id: clrpick.tcl,v 1.10 2000/04/04 08:09:24 hobbs Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # @@ -154,12 +154,19 @@ proc tkColorDialog_Config {w argList} { # 1: the configuration specs # - set specs { - {-initialcolor "" "" ""} - {-parent "" "" "."} - {-title "" "" "Color"} + if {[info exists tkPriv(selectColor)] && \ + [string compare $tkPriv(selectColor) ""]} { + set defaultColor $tkPriv(selectColor) + } else { + set defaultColor [. cget -background] } + set specs [list \ + [list -initialcolor "" "" $defaultColor] \ + [list -parent "" "" "."] \ + [list -title "" "" "Color"] \ + ] + # 2: parse the arguments # tclParseConfigSpec $w $specs "" $argList @@ -167,17 +174,8 @@ proc tkColorDialog_Config {w argList} { if {[string equal $data(-title) ""]} { set data(-title) " " } - if {[string equal $data(-initialcolor) ""]} { - if {[info exists tkPriv(selectColor)] && \ - [string compare $tkPriv(selectColor) ""]} { - set data(-initialcolor) $tkPriv(selectColor) - } else { - set data(-initialcolor) [. cget -background] - } - } else { - if {[catch {winfo rgb . $data(-initialcolor)} err]} { - error $err - } + if {[catch {winfo rgb . $data(-initialcolor)} err]} { + error $err } if {![winfo exists $data(-parent)]} { |