summaryrefslogtreecommitdiff
path: root/support/tcltexed/lib/color.tcl
blob: 291d84fc9afe21b39161b7d7ebc2e74828be4e04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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
 }
}