home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>Tk::ColorEditor - a general purpose Tk widget Color Editor</TITLE>
- <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
- <LINK REV="made" HREF="mailto:">
- </HEAD>
-
- <BODY>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Tk::ColorEditor - a general purpose Tk widget Color Editor</P></STRONG>
- </TD></TR>
- </TABLE>
-
- <A NAME="__index__"></A>
- <!-- INDEX BEGIN -->
-
- <UL>
-
- <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
-
- <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <LI><A HREF="#authors">AUTHORS</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>Tk::ColorEditor - a general purpose Tk widget Color Editor</P>
- <P>
- <HR>
- <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
- <UL>
- <LI>Linux</LI>
- <LI>Solaris</LI>
- <LI>Windows</LI>
- </UL>
- <HR>
- <H1><A NAME="synopsis">SYNOPSIS</A></H1>
- <PRE>
- use Tk::ColorEditor;</PRE>
- <PRE>
- $cref = $mw->ColorEditor(-title => $title, -cursor => @cursor);</PRE>
- <PRE>
- $cref->Show;</PRE>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>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 <CODE>Show()</CODE>
- method.</P>
- <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>
- <OL>
- <LI>
- Call the constructor to create the editor object, which in turn returns a
- blessed reference to the new object:
- <PRE>
- use Tk::ColorEditor;</PRE>
- <PRE>
- $cref = $mw->ColorEditor(
- -title => $title,
- -cursor => @cursor,
- );</PRE>
- <PRE>
- mw - a window reference, usually the result of a MainWindow->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
- "hot spots".</PRE>
- <P></P>
- <LI>
- Invoke the <CODE>configure()</CODE> method to change editor characteristics:
- <PRE>
- $cref->configure(-option => value, ..., -option-n => value-n);</PRE>
- <PRE>
- options:
- -command : a callback to a `set_colors' replacement.
- -widgets : a reference to a list of widget references
- for the color configurator.
- -display_status : TRUE IFF display the ColorEditor status
- window when applying colors.
- -add_menu_item : 'SEP', or a color attribute menu item.
- -delete_menu_item : 'SEP', a color attribute menu item, or color
- attribute menu ordinal.</PRE>
- <PRE>
- For example:</PRE>
- <PRE>
- $cref->configure(-delete_menu_item => 3,
- -delete_menu_item => 'disabledforeground',
- -add_menu_item => 'SEP',
- -add_menu_item => 'New color attribute',
- -widgets => [$ce, $qu, $f2b2],
- -widgets => [$f2->Descendants],
- -command => [\&my_special_configurator, some, args ]
- );</PRE>
- <P></P>
- <LI>
- Invoke the <CODE>Show()</CODE> method on the editor object, say, by a button or menu press:
- <PRE>
- $cref->Show;</PRE>
- <P></P>
- <LI>
- The <CODE>cget(-widgets)</CODE> 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 <CODE>configure()</CODE> call to expand your
- color list.
- <PRE>
- $cref->configure(
- -widgets => [
- @{$Filesystem_ref->cget(-widgets)}, @{$cref->cget(-widgets)},
- ]
- );</PRE>
- <P></P>
- <LI>
- The <CODE>delete_widgets()</CODE> method expects a reference to a list of widgets which are
- then removed from the current color list.
- <PRE>
- $cref->delete_widgets($OBJTABLE{$objname}->{'-widgets'})</PRE>
- <P></P></OL>
- <P>
- <HR>
- <H1><A NAME="authors">AUTHORS</A></H1>
- <P>Stephen O. Lidie, Lehigh University Computing Center. 95/03/05
- <A HREF="mailto:lusol@Lehigh.EDU">lusol@Lehigh.EDU</A></P>
- <P>Many thanks to Guy Decoux (<A HREF="mailto:decoux@moulon.inra.fr">decoux@moulon.inra.fr</A>) for doing the initial
- translation of tcolor.tcl to TkPerl, from which this code has been derived.</P>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Tk::ColorEditor - a general purpose Tk widget Color Editor</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-