1tk_setPalette(n)             Tk Built-In Commands             tk_setPalette(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       tk_setPalette, tk_bisque - Modify the Tk color palette
9

SYNOPSIS

11       tk_setPalette background
12
13       tk_setPalette name value ?name value ...?
14
15       tk_bisque
16_________________________________________________________________
17
18

DESCRIPTION

20       The  tk_setPalette  procedure changes the color scheme for Tk.  It does
21       this by modifying the colors of existing widgets and  by  changing  the
22       option  database  so that future widgets will use the new color scheme.
23       If tk_setPalette is invoked with a single argument, the argument is the
24       name  of  a color to use as the normal background color;  tk_setPalette
25       will compute a complete  color  palette  from  this  background  color.
26       Alternatively, the arguments to tk_setPalette may consist of any number
27       of name-value pairs, where the first argument of the pair is  the  name
28       of  an  option in the Tk option database and the second argument is the
29       new value to use for that option.  The  following  database  names  are
30       currently  supported:  activeBackground               foregroundselect‐
31       Color     activeForeground               highlightBackgroundselectBack‐
32       ground   background      highlightColor selectForeground  disabledFore‐
33       ground             insertBackgroundtroughColor tk_setPalette  tries  to
34       compute  reasonable  defaults  for any options that you do not specify.
35       You can specify options other than the above ones and  Tk  will  change
36       those  options  on  widgets as well.  This feature may be useful if you
37       are using custom widgets with additional color options.
38
39       Once it has computed the new  value  to  use  for  each  of  the  color
40       options, tk_setPalette scans the widget hierarchy to modify the options
41       of all existing widgets.  For each widget, it checks to see if  any  of
42       the  above  options  is  defined  for  the  widget.   If so, and if the
43       option's current value is the default, then the value is  changed;   if
44       the  option  has a value other than the default, tk_setPalette will not
45       change it.  The default for an option is the one provided by the widget
46       ([lindex  [$w  configure $option] 3]) unless tk_setPalette has been run
47       previously, in which case it is the value  specified  in  the  previous
48       invocation of tk_setPalette.
49
50       After  modifying all the widgets in the application, tk_setPalette adds
51       options to the option database to change the defaults for widgets  cre‐
52       ated  in  the  future.  The new options are added at priority widgetDe‐
53       fault, so they will be overridden by options from the  .Xdefaults  file
54       or options specified on the command-line that creates a widget.
55
56       The  procedure  tk_bisque  is  provided  for backward compatibility: it
57       restores the application's colors to the light brown  (“bisque”)  color
58       scheme used in Tk 3.6 and earlier versions.
59
60

KEYWORDS

62       bisque, color, palette
63
64
65
66Tk                                    4.0                     tk_setPalette(n)
Impressum