summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-04-04 08:09:24 (GMT)
committerhobbs <hobbs@noemail.net>2000-04-04 08:09:24 (GMT)
commite724b1935ce2d66be7737a64ee7ef5400351ea8c (patch)
tree3f8c5806161fdf8153142532753bb5c4e5747226
parentea496991cc0672160ad03339892154eea4e4d96d (diff)
downloadtk-e724b1935ce2d66be7737a64ee7ef5400351ea8c.zip
tk-e724b1935ce2d66be7737a64ee7ef5400351ea8c.tar.gz
tk-e724b1935ce2d66be7737a64ee7ef5400351ea8c.tar.bz2
* library/clrpick.tcl (tkColorDialog_Config): error now thrown
when -initialcolor "" specified. [Bug: 4198] FossilOrigin-Name: cfdf219f59bc48bbd22f37fec0b5ddc2bad29f15
-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)]} {