The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<!-- manual page source format generated by RosettaMan, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEADER>
<TITLE>ColorEditor(man) manual page</TITLE>
</HEADER>
<BODY>
<A HREF="#toc">Table of Contents</A><P>

<A NAME="sect0" HREF="#toc0"><H2>NAME</H2></A>
ColorEditor - a general purpose Tk widget Color Editor (based on tcolor.tcl from the Tcl/Tk distribution).<P>

<A NAME="sect1" HREF="#toc1"><H2>SYNOPSIS</H2></A>
<P>
require Tk::ColorEditor;<P>
$cref = $mw-&gt;ColorEditor(-title =&gt; $title, -cursor =&gt; @cursor);<P>
$cref-&gt;show;<P>

<A NAME="sect2" HREF="#toc2"><H2>DESCRIPTION</H2></A>
ColorEditor is implemented as an object with various methods, described below. First, create your ColorEditor object during program initialization (one should be sufficient), and then configure it by specifying a list of Tk widgets to colorize. When it's time to use the editor, invoke the `show' method.<P>
ColorEditor allows some customization: you may alter the color attribute menu by adding and/or deleting menu items and/or separators, turn the status window on or off, alter the configurator's list of color widgets, or even supply your own custom color configurator callback.<P>
1. Call the constructor to create the editor object, which in turn returns a blessed reference to the new object:<P>
require Tk::ColorEditor;<P>
$cref = $mw-&gt;ColorEditor(<BR>
 -title =&gt; $title,<BR>
 -cursor =&gt; @cursor,<BR>
 );<P>
<dl>
<dt>mw <dd>    - a window reference, usually the result of a MainWindow-&gt;new call. As the default root of a widget tree, $mw and all descendant widgets at object-creation-time are configured by the default color configurator procedure. (You probably want to change this though or you might end up colorizing ColorEditor!) title - Toplevel title, default = ` `. cursor - a valid Tk `-cursor' specification (default is `top_left_arrow'). This cursor is used over all ColorEditor &quot;hot spots".<P>
</dd>
</dl>
2. Invoke the `configure' method to change editor characteristics:<P>
$cref-&gt;configure(-option =&gt; value, ..., -option-n =&gt; value-n);<P>
options:<BR>
 <dl>
<dt>-command <dd>            : a callback to a `set_colors' replacement. </dd>
</dl>
<dl>
<dt>-widgets <dd>            : a reference to a list of widget references for the color configurator. </dd>
</dl>
<dl>
<dt>-display_status <dd>     : TRUE IFF display the ColorEditor status window when applying colors. </dd>
</dl>
<dl>
<dt>-add_menu_item <dd>      : `SEP', or a color attribute menu item. </dd>
</dl>
<dl>
<dt>-delete_menu_item <dd>   : `SEP', a color attribute menu item, or color attribute menu ordinal.<P>
</dd>
</dl>
For example:<P>
<dl>
<dt>$cref-&gt;configure(-delete_menu_item <dd>=&gt; 3, </dd>
</dl>
<dl>
<dt>-delete_menu_item <dd>=&gt; `disabledforeground', </dd>
</dl>
<dl>
<dt>-add_menu_item <dd>     =&gt; `SEP', </dd>
</dl>
<dl>
<dt>-add_menu_item <dd>     =&gt; `New color attribute', </dd>
</dl>
<dl>
<dt>-widgets <dd>           =&gt; [$ce, $qu, $f2b2], </dd>
</dl>
<dl>
<dt>-widgets <dd>           =&gt; [$f2-&gt;descendants], </dd>
</dl>
<dl>
<dt>-command <dd>           =&gt; [\&amp;my_special_configurator, some, args ] );<P>
</dd>
</dl>
3. Invoke the `show' method on the editor object, say, by a button or menu press:<P>
$cref-&gt;show;<P>
4. The <I>cget</I>('-widgets') method returns a reference to a list of widgets that are colorized by the configurator. Typically, you add new widgets to this list and then use it in a subsequent `configure' call to expand your color list.<P>
$cref-&gt;configure(<BR>
 -widgets =&gt; [<BR>
 @{$Filesystem_ref-&gt;cget('widgets')}, @{$cref-&gt;cget('-widgets')}, ]<BR>
 );<P>
5. The `delete_widgets' method expects a reference to a list of widgets which are then removed from the current color list.<P>
$cref-&gt;delete_widgets($OBJTABLE{$objname}-&gt;{'-widgets'})<P>

<A NAME="sect3" HREF="#toc3"><H2>AUTHORS</H2></A>
Stephen O. Lidie, Lehigh University Computing Center. 95/03/05 lusol@Lehigh.EDU<P>
Many thanks to Guy Decoux (decoux@moulon.inra.fr) for doing the initial translation of tcolor.tcl to TkPerl, from which this code has been derived.<P>

<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc0" HREF="#sect0">NAME</A></LI>
<LI><A NAME="toc1" HREF="#sect1">SYNOPSIS</A></LI>
<LI><A NAME="toc2" HREF="#sect2">DESCRIPTION</A></LI>
<LI><A NAME="toc3" HREF="#sect3">AUTHORS</A></LI>
</UL>
</BODY></HTML>