1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" RCS: @(#) $Id: palette.n,v 1.1.1.1 2002-01-16 10:25:49 markom Exp $
|
8 |
|
|
'\"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.TH tk_setPalette n 4.0 Tk "Tk Built-In Commands"
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
tk_setPalette, tk_bisque \- Modify the Tk color palette
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBtk_setPalette \fIbackground\fR
|
17 |
|
|
.sp
|
18 |
|
|
\fBtk_setPalette \fIname value \fR?\fIname value ...\fR?
|
19 |
|
|
.sp
|
20 |
|
|
\fBtk_bisque\fR
|
21 |
|
|
.BE
|
22 |
|
|
|
23 |
|
|
.SH DESCRIPTION
|
24 |
|
|
.PP
|
25 |
|
|
The \fBtk_setPalette\fR procedure changes the color scheme for Tk.
|
26 |
|
|
It does this by modifying the colors of existing widgets and by changing
|
27 |
|
|
the option database so that future widgets will use the new color scheme.
|
28 |
|
|
If \fBtk_setPalette\fR is invoked with a single argument, the
|
29 |
|
|
argument is the name of a color to use as the normal background
|
30 |
|
|
color; \fBtk_setPalette\fR will compute a complete color palette
|
31 |
|
|
from this background color.
|
32 |
|
|
Alternatively, the arguments to \fBtk_setPalette\fR may consist of any number
|
33 |
|
|
of \fIname\fR\-\fIvalue\fR pairs, where the first argument of the pair
|
34 |
|
|
is the name of an option in the Tk option database and the second
|
35 |
|
|
argument is the new value to use for that option. The following
|
36 |
|
|
database names are currently supported:
|
37 |
|
|
.DS L
|
38 |
|
|
.ta 4c 8c
|
39 |
|
|
\fBactiveBackground foreground selectColor
|
40 |
|
|
activeForeground highlightBackground selectBackground
|
41 |
|
|
background highlightColor selectForeground
|
42 |
|
|
disabledForeground insertBackground troughColor\fR
|
43 |
|
|
.DE
|
44 |
|
|
\fBtk_setPalette\fR tries to compute reasonable defaults for any
|
45 |
|
|
options that you don't specify. You can specify options other
|
46 |
|
|
than the above ones and Tk will change those options on widgets as
|
47 |
|
|
well. This feature may be useful if you are using custom widgets with
|
48 |
|
|
additional color options.
|
49 |
|
|
.PP
|
50 |
|
|
Once it has computed the new value to use for each of the color options,
|
51 |
|
|
\fBtk_setPalette\fR scans the widget hierarchy to modify the options
|
52 |
|
|
of all existing widgets. For each widget, it checks to see if any
|
53 |
|
|
of the above options is defined for the widget. If so, and if the
|
54 |
|
|
option's current value is the default, then the value is changed; if
|
55 |
|
|
the option has a value other than the default, \fBtk_setPalette\fR
|
56 |
|
|
will not change it. The default for an option is the one provided by
|
57 |
|
|
the widget (\fB[lindex [$w configure $option] 3]\fR) unless
|
58 |
|
|
\fBtk_setPalette\fR has been run previously, in which case it is the
|
59 |
|
|
value specified in the previous invocation of \fBtk_setPalette\fR.
|
60 |
|
|
.PP
|
61 |
|
|
After modifying all the widgets in the application, \fBtk_setPalette\fR
|
62 |
|
|
adds options to the option database to change the defaults for
|
63 |
|
|
widgets created in the future. The new options are added at
|
64 |
|
|
priority \fBwidgetDefault\fR, so they will be overridden by options
|
65 |
|
|
from the .Xdefaults file or options specified on the command-line
|
66 |
|
|
that creates a widget.
|
67 |
|
|
.PP
|
68 |
|
|
The procedure \fBtk_bisque\fR is provided for backward compatibility:
|
69 |
|
|
it restores the application's colors to the light brown (``bisque'')
|
70 |
|
|
color scheme used in Tk 3.6 and earlier versions.
|
71 |
|
|
|
72 |
|
|
.SH KEYWORDS
|
73 |
|
|
bisque, color, palette
|