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 / ColorEditor.pod
CommitLineData
86530b38
AT
1
2=head1 NAME
3
4Tk::ColorEditor - a general purpose Tk widget Color Editor
5
6=for pm Tk/ColorEditor.pm
7
8=for category Popups and Dialogs
9
10=head1 SYNOPSIS
11
12 use Tk::ColorEditor;
13
14 $cref = $mw->ColorEditor(-title => $title, -cursor => @cursor);
15
16 $cref->Show;
17
18=head1 DESCRIPTION
19
20ColorEditor is implemented as an object with various methods, described
21below. First, create your ColorEditor object during program initialization
22(one should be sufficient), and then configure it by specifying a list of Tk
23widgets to colorize. When it's time to use the editor, invoke the Show()
24method.
25
26ColorEditor allows some customization: you may alter the color attribute
27menu by adding and/or deleting menu items and/or separators, turn the status
28window on or off, alter the configurator's list of color widgets, or even
29supply your own custom color configurator callback.
30
31=over 4
32
33=item 1.
34
35Call the constructor to create the editor object, which in turn returns a
36blessed reference to the new object:
37
38 use Tk::ColorEditor;
39
40 $cref = $mw->ColorEditor(
41 -title => $title,
42 -cursor => @cursor,
43 );
44
45 mw - a window reference, usually the result of a MainWindow->new
46 call. As the default root of a widget tree, $mw and all
47 descendant widgets at object-creation-time are configured
48 by the default color configurator procedure. (You probably
49 want to change this though or you might end up colorizing
50 ColorEditor!)
51 title - Toplevel title, default = ' '.
52 cursor - a valid Tk '-cursor' specification (default is
53 'top_left_arrow'). This cursor is used over all ColorEditor
54 "hot spots".
55
56=item 2.
57
58Invoke the configure() method to change editor characteristics:
59
60 $cref->configure(-option => value, ..., -option-n => value-n);
61
62 options:
63 -command : a callback to a `set_colors' replacement.
64 -widgets : a reference to a list of widget references
65 for the color configurator.
66 -display_status : TRUE IFF display the ColorEditor status
67 window when applying colors.
68 -add_menu_item : 'SEP', or a color attribute menu item.
69 -delete_menu_item : 'SEP', a color attribute menu item, or color
70 attribute menu ordinal.
71
72 For example:
73
74 $cref->configure(-delete_menu_item => 3,
75 -delete_menu_item => 'disabledforeground',
76 -add_menu_item => 'SEP',
77 -add_menu_item => 'New color attribute',
78 -widgets => [$ce, $qu, $f2b2],
79 -widgets => [$f2->Descendants],
80 -command => [\&my_special_configurator, some, args ]
81 );
82
83=item 3.
84
85Invoke the Show() method on the editor object, say, by a button or menu press:
86
87 $cref->Show;
88
89=item 4.
90
91The cget(-widgets) method returns a reference to a list of widgets that
92are colorized by the configurator. Typically, you add new widgets to
93this list and then use it in a subsequent configure() call to expand your
94color list.
95
96 $cref->configure(
97 -widgets => [
98 @{$Filesystem_ref->cget(-widgets)}, @{$cref->cget(-widgets)},
99 ]
100 );
101
102=item 5.
103
104The delete_widgets() method expects a reference to a list of widgets which are
105then removed from the current color list.
106
107 $cref->delete_widgets($OBJTABLE{$objname}->{'-widgets'})
108
109=back
110
111=head1 AUTHORS
112
113Stephen O. Lidie, Lehigh University Computing Center. 95/03/05
114lusol@Lehigh.EDU
115
116Many thanks to Guy Decoux (decoux@moulon.inra.fr) for doing the initial
117translation of tcolor.tcl to TkPerl, from which this code has been derived.
118
119=cut
120