summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-04-04 08:09:24 (GMT)
committerhobbs <hobbs>2000-04-04 08:09:24 (GMT)
commitecd9de89e626b4396dbdf72360dcb8b9360687bd (patch)
tree3f8c5806161fdf8153142532753bb5c4e5747226 /library
parent2a86dab1b1bc617709095cbcb64a0caff3ccf2d5 (diff)
downloadtk-ecd9de89e626b4396dbdf72360dcb8b9360687bd.zip
tk-ecd9de89e626b4396dbdf72360dcb8b9360687bd.tar.gz
tk-ecd9de89e626b4396dbdf72360dcb8b9360687bd.tar.bz2
* library/clrpick.tcl (tkColorDialog_Config): error now thrown
when -initialcolor "" specified. [Bug: 4198]
Diffstat (limited to 'library')
-rw-r--r--library/clrpick.tcl30
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)]} {