# Copyright (C) 1999 - Martin Strauss - under terms of GPL
################################################################
# defaultcolors
switch $tcl_platform(platform) unix {
tk_setPalette\
activebackground "#ececec"\
activeforeground Black\
background "#d9d9d9"\
foreground Black\
selectcolor White\
disabledforeground "#a3a3a3"\
highlightbackground "#d9d9d9"\
highlightcolor Black
} windows {
tk_setPalette\
activebackground "#ececec"\
activeforeground Black\
background "#c0c0c0"\
foreground Black\
selectcolor White\
disabledforeground "#a3a3a3"\
highlightbackground "#d9d9d9"\
highlightcolor Black
}
################################################################
# if colors make trouble
set COLOR_list [list\
"-activebackground"\
"-activeforeground"\
"-background"\
"-disabledforeground"\
"-foreground"\
"-highlightbackground"\
"-highlightcolor"\
"-insertbackground"\
"-selectbackground"\
"-selectcolor"\
"-selectforeground"\
"-troughcolor"\
]
proc COLOR_LOOP {E} {
global COLOR_list
foreach i [$E configure] {
if {[lsearch -exact $COLOR_list [lindex $i 0]] != -1} {
$E configure [lindex $i 0] [lindex $i 3]
}
}
foreach i [winfo children $E] {COLOR_LOOP $i}
}
proc COLOR {E} {
global COLOR_flag
if $COLOR_flag {
COLOR_LOOP $E
}
}