home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>Tk::Compound - Create multi-line compound images.</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::Compound - Create multi-line compound images.</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="#description">DESCRIPTION</A></LI>
- <LI><A HREF="#creating compound images">CREATING COMPOUND IMAGES</A></LI>
- <LI><A HREF="#image command">IMAGE COMMAND</A></LI>
- <LI><A HREF="#example">EXAMPLE</A></LI>
- <LI><A HREF="#keywords">KEYWORDS</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>Tk::Compound - Create multi-line compound images.</P>
- <P> use Tk::Compound;
- <EM>$image</EM> = <EM>$widget</EM>-><STRONG>Compound</STRONG>?(<EM>name</EM>??,<EM>options</EM>?)
- <EM>$image</EM>-><STRONG>Line</STRONG>?(<EM>options</EM>?)
- <EM>$image</EM>-><STRONG>Text</STRONG>?(<EM>options</EM>?)
- <EM>$image</EM>-><STRONG>Bitmap</STRONG>?(<EM>options</EM>?)
- <EM>$image</EM>-><STRONG>Image</STRONG>?(<EM>options</EM>?)
- <EM>$image</EM>-><STRONG>Space</STRONG>?(<EM>options</EM>?)</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="description">DESCRIPTION</A></H1>
- <P>Compound image types can be used to create images that consists of
- multiple horizontal lines; each line is composed of a series of items
- (texts, bitmaps, images or spaces) arranged from left to
- right. Compound images are mainly used to embed complex drawings into
- widgets that support the <STRONG>-image</STRONG> option. As shown in the EXAMPLE
- section below, a compound image can be used to display a bitmap and a
- text string simutaneously in a Tk <STRONG>Button</STRONG> widget.</P>
- <P>Compound images can only be used on windows on the same display as, and
- with the same pixel depth and visual as the <EM>$widget</EM> used to create them.</P>
- <P>
- <HR>
- <H1><A NAME="creating compound images">CREATING COMPOUND IMAGES</A></H1>
- <P>Compounds are created using <EM>$widget</EM>-><STRONG>Compound</STRONG>.
- Compounds support the following <EM>options</EM>:</P>
- <DL>
- <DT><STRONG><A NAME="item_%2Dbackground_%3D%3E_color"><STRONG>-background</STRONG> => <EM>color</EM></A></STRONG><BR>
- <DD>
- Specifies the background color of the compound image. This color is
- also used as the default background color for the bitmap items in the
- compound image.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dborderwidth_%3D%3E_pixels"><STRONG>-borderwidth</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- Specifies a non-negative value indicating the width of the 3-D border
- drawn around the compound image.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfont_%3D%3E_font"><STRONG>-font</STRONG> => <EM>font</EM></A></STRONG><BR>
- <DD>
- Specifies the default font for the text items in the compound image.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dforeground_%3D%3E_color"><STRONG>-foreground</STRONG> => <EM>color</EM></A></STRONG><BR>
- <DD>
- Specifies the default foreground color for the bitmap and text items
- in the compound image.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dpadx_%3D%3E_value"><STRONG>-padx</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- Specifies a non-negative value indicating how much extra space to
- request for the compound image in the X-direction. The <EM>value</EM> may
- have any of the forms acceptable to <STRONG>Tk_GetPixels(3)</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dpady_%3D%3E_value"><STRONG>-pady</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- Specifies a non-negative value indicating how much extra space to
- request for the compound image in the Y-direction.
- <P></P>
- <DT><STRONG><A NAME="item_%2Drelief_%3D%3E_value"><STRONG>-relief</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- Specifies the 3-D effect desired for the background of the compound
- image. Acceptable values are <STRONG>raised</STRONG>, <STRONG>sunken</STRONG>, <STRONG>flat</STRONG>,
- <STRONG>ridge</STRONG>, and <STRONG>groove</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dshowbackground_%3D%3E_value"><STRONG>-showbackground</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- Specifies whether the background and the 3D borders should be drawn.
- Must be a valid boolean value. By default the background is not drawn
- and the compound image appears to have a transparent background.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="image command">IMAGE COMMAND</A></H1>
- <P>When a compound image is created, Tk also creates a new object.
- This object supports the <STRONG>configure</STRONG> and <STRONG>cget</STRONG> methods
- described in <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> which can be used to enquire and
- modify the options described above.
- </P>
- <PRE>
-
- The object also supports the following methods:</PRE>
- <DL>
- <DT><STRONG><A NAME="item_Line"><EM>$compound</EM>-><STRONG>Line</STRONG>?(<EM>option =</EM> value ...>)?</A></STRONG><BR>
- <DD>
- Creates a new line at the bottom of the compound image. Lines support
- the following <EM>options</EM>:
- <DL>
- <DT><STRONG><A NAME="item_%2Danchor_value"><STRONG>-anchor</STRONG> value</A></STRONG><BR>
- <DD>
- Specifies how the line should be aligned along the horizontal axis.
- When the values are <STRONG>w</STRONG>, <STRONG>sw</STRONG> or <STRONG>nw</STRONG>, the line is aligned
- to the left. When the values are <STRONG>c</STRONG>, <STRONG>s</STRONG> or <STRONG>n</STRONG>, the line
- is aligned to the middle. When the values are <STRONG>e</STRONG>, <STRONG>se</STRONG> or
- <STRONG>ne</STRONG>, the line is aligned to the right.
- <P></P>
- <DT><STRONG><STRONG>-padx</STRONG> => <EM>value</EM></STRONG><BR>
- <DD>
- Specifies a non-negative value indicating how much extra space to
- request for this line in the X-direction.
- <P></P></DL>
- <DT><STRONG><A NAME="item_Itemtype"><EM>$compound</EM>-><EM>Itemtype</EM>?(<EM>option =</EM> value ...>)?</A></STRONG><BR>
- <DD>
- Creates a new item of the type <EM>Itemtype</EM> at the end of the last
- line of the compound image. All types of items support
- these following common <EM>options</EM>:
- <DL>
- <DT><STRONG><STRONG>-anchor</STRONG> value</STRONG><BR>
- <DD>
- Specifies how the item should be aligned along the vertical axis. When
- the values are <STRONG>n</STRONG>, <STRONG>nw</STRONG> or <STRONG>ne</STRONG>, the item is aligned to
- the top of the line. When the values are <STRONG>c</STRONG>, <STRONG>w</STRONG> or <STRONG>e</STRONG>,
- the item is aligned to the middle of the line. When the values are
- <STRONG>s</STRONG>, <STRONG>se</STRONG> or <STRONG>sw</STRONG>, the item is aligned to the bottom of
- the line.
- <P></P>
- <DT><STRONG><STRONG>-padx</STRONG> => <EM>value</EM></STRONG><BR>
- <DD>
- Specifies a non-negative value indicating how much extra space to
- request for this item in the X-direction.
- <P></P>
- <DT><STRONG><STRONG>-pady</STRONG> => <EM>value</EM></STRONG><BR>
- <DD>
- Specifies a non-negative value indicating how much extra space to
- request for this item in the Y-direction.
- <P></P>
- <DT><STRONG><A NAME="item_item%2Dtype_can_be_any_of_the_following%3A"><EM>item-type</EM> can be any of the following:</A></STRONG><BR>
- <DD>
- </DL>
- <DT><STRONG><A NAME="item_Bitmap"><EM>$compound</EM>-><STRONG>Bitmap</STRONG>?(<EM>option =</EM> value ...>)?</A></STRONG><BR>
- <DD>
- Creates a new bitmap item of at the end of the last
- line of the compound image. Additional <EM>options</EM> accepted by the
- bitmap type are:
- <DL>
- <DT><STRONG><STRONG>-background</STRONG> => <EM>color</EM></STRONG><BR>
- <DD>
- Specifies the background color of the bitmap item.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dbitmap_%3D%3E_name"><STRONG>-bitmap</STRONG> => <EM>name</EM></A></STRONG><BR>
- <DD>
- Specifies a bitmap to display in this item, in any of the forms
- acceptable to <STRONG>Tk_GetBitmap(3)</STRONG>.
- <P></P>
- <DT><STRONG><STRONG>-foreground</STRONG> => <EM>color</EM></STRONG><BR>
- <DD>
- Specifies the foreground color of the bitmap item.
- <P></P></DL>
- <DT><STRONG><A NAME="item_Image"><EM>$compound</EM>-><STRONG>Image</STRONG>?(<EM>option =</EM> value ...>)?</A></STRONG><BR>
- <DD>
- Creates a new image item of at the end of the last
- line of the compound image. Additional <EM>options</EM> accepted by the
- image type are:
- <DL>
- <DT><STRONG><A NAME="item_%2Dimage_%3D%3E_name"><STRONG>-image</STRONG> => <EM>name</EM></A></STRONG><BR>
- <DD>
- Specifies an image to display in this item. <EM>name</EM>
- must have been created with the <STRONG>image create</STRONG> command.
- <P></P></DL>
- <DT><STRONG><A NAME="item_Space"><EM>$compound</EM>-><STRONG>Space</STRONG>?(<EM>option =</EM> value ...>)?</A></STRONG><BR>
- <DD>
- Creates a new space item of at the end of the last line of the
- compound image. Space items do not display anything. They just acts as
- space holders that add additional spaces between items inside a
- compound image. Additional <EM>options</EM> accepted by the image type
- are:
- <DL>
- <DT><STRONG><A NAME="item_%2Dwidth_%3D%3E_value"><STRONG>-width</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- Specifies the width of this space. The <EM>value</EM> may have any of the
- forms acceptable to <STRONG>Tk_GetPixels(3)</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dheight_%3D%3E_value"><STRONG>-height</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- Specifies the height of this space. The <EM>value</EM> may have any of
- the forms acceptable to <STRONG>Tk_GetPixels(3)</STRONG>.
- <P></P></DL>
- <DT><STRONG><A NAME="item_Text"><EM>$compound</EM>-><STRONG>Text</STRONG>?(<EM>option =</EM> value ...>)?</A></STRONG><BR>
- <DD>
- Creates a new text item of at the end of the last line of the compound
- image. Additional <EM>options</EM> accepted by the text type are:
- <DL>
- <DT><STRONG><STRONG>-background</STRONG> => <EM>color</EM></STRONG><BR>
- <DD>
- Specifies the background color of the text item.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfont_%3D%3E_name"><STRONG>-font</STRONG> => <EM>name</EM></A></STRONG><BR>
- <DD>
- Specifies the font to be used for this text item.
- <P></P>
- <DT><STRONG><STRONG>-foreground</STRONG> => <EM>color</EM></STRONG><BR>
- <DD>
- Specifies the foreground color of the text item.
- <P></P>
- <DT><STRONG><A NAME="item_%2Djustify_value"><STRONG>-justify</STRONG> <EM>value</EM></A></STRONG><BR>
- <DD>
- When there are multiple lines of text displayed in a text item, this
- option determines how the lines line up with each other. <EM>value</EM>
- must be one of <STRONG>left</STRONG>, <STRONG>center</STRONG>, or <STRONG>right</STRONG>. <STRONG>Left</STRONG>
- means that the lines' left edges all line up, <STRONG>center</STRONG> means that
- the lines' centers are aligned, and <STRONG>right</STRONG> means that the lines'
- right edges line up.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dtext_%3D%3E_string"><STRONG>-text</STRONG> => <EM>string</EM></A></STRONG><BR>
- <DD>
- Specifies a text string to display in this text item.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dunderline_value"><STRONG>-underline</STRONG> <EM>value</EM></A></STRONG><BR>
- <DD>
- Specifies the integer index of a character to underline in the text
- item. 0 corresponds to the first character of the text displayed in
- the text item, 1 to the next character, and so on.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dwraplength_value"><STRONG>-wraplength</STRONG> <EM>value</EM></A></STRONG><BR>
- <DD>
- This option specifies the maximum line length of the label string on
- this text item. If the line length of the label string exceeds this
- length, it is wrapped onto the next line, so that no line is longer
- than the specified length. The value may be specified in any of the
- standard forms for screen distances. If this value is less than or
- equal to 0 then no wrapping is done: lines will break only at newline
- characters in the text.
- <P></P></DL>
- </DL>
- <P>
- <HR>
- <H1><A NAME="example">EXAMPLE</A></H1>
- <P>The following example creates a compound image with a bitmap and a
- text string and places this image into a <STRONG>Button(n)</STRONG>
- widget. Notice that the image must be created using the widget
- that it resides in.</P>
- <PRE>
- my $b = $parent->Button;
- my $c = $b->Compound;
- $b->configure(-image => $c);
- $c->Line;
- $c->Bitmap(-bitmap => 'warning');
- $c->Space(-width => 8);
- $c->Text(-text => "Warning", -underline => 0);
- $b->pack;</PRE>
- <P>
- <HR>
- <H1><A NAME="keywords">KEYWORDS</A></H1>
- <P>image(n), <CODE>Tix(n)</CODE></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::Compound - Create multi-line compound images.</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-