Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / sun4-solaris / Tk / palette.pod
CommitLineData
86530b38
AT
1# Copyright (c) 1995-1996 Sun Microsystems, Inc.
2# See the file "license.terms" for information on usage and redistribution
3# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
4#
5#
6
7=head1 NAME
8
9setPalette, bisque - Modify the Tk color palette
10
11=for category Creating and Configuring Widgets
12
13=head1 SYNOPSIS
14
15I<$widget>-E<gt>B<setPalette>(I<background>)
16
17I<$widget>-E<gt>B<setPalette(>I<name>=E<gt>I<value>?,I<name>=E<gt>I<value ...>?)
18
19I<$widget>-E<gt>B<bisque>
20
21=head1 DESCRIPTION
22
23The B<setPalette> method changes the color scheme for Tk.
24It does this by modifying the colors of existing widgets and by changing
25the option database so that future widgets will use the new color scheme.
26If B<setPalette> is invoked with a single argument, the
27argument is the name of a color to use as the normal background
28color; B<setPalette> will compute a complete color palette
29from this background color.
30Alternatively, the arguments to B<setPalette> may consist of any number
31of I<name>-I<value> pairs, where the first argument of the pair
32is the name of an option in the Tk option database and the second
33argument is the new value to use for that option. The following
34database names are currently supported:
35
36 activeBackground foreground selectColor
37 activeForeground highlightBackground selectBackground
38 background highlightColor selectForeground
39 disabledForeground insertBackground troughColor
40
41B<setPalette> tries to compute reasonable defaults for any
42options that you don't specify. You can specify options other
43than the above ones and Tk will change those options on widgets as
44well. This feature may be useful if you are using custom widgets with
45additional color options.
46
47Once it has computed the new value to use for each of the color options,
48B<setPalette> scans the widget hierarchy to modify the options
49of all existing widgets. For each widget, it checks to see if any
50of the above options is defined for the widget. If so, and if the
51option's current value is the default, then the value is changed; if
52the option has a value other than the default, B<setPalette>
53will not change it. The default for an option is the one provided by
54the widget (B<($w-E<gt>configure('option'))[3]>) unless
55B<setPalette> has been run previously, in which case it is the
56value specified in the previous invocation of B<setPalette>.
57
58After modifying all the widgets in the application, B<setPalette>
59adds options to the option database to change the defaults for
60widgets created in the future. The new options are added at
61priority B<widgetDefault>, so they will be overridden by options
62from the .Xdefaults file or options specified on the command-line
63that creates a widget.
64
65The method B<bisque> is provided for backward compatibility:
66it restores the application's colors to the light brown (``bisque'')
67color scheme used in Tk 3.6 and earlier versions.
68
69=head1 BUGS
70
71The use of option database names rather than the configure names is
72understandable given the mechanism (copied from Tcl/Tk), but
73is potentially confusing.
74
75The interpolation of different 'shades' of color used for 3D effects
76in 'RGB' space can lead to undesirable changes in 'hue'.
77Interpolation in 'HSV' (as used in B<Tk::ColorEditor>) would be more
78robust and X11R5's color support probably even more so.
79
80=head1 SEE ALSO
81
82L<Tk::options|Tk::options>
83
84=head1 KEYWORDS
85
86bisque, color, palette
87
88=cut
89