home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>Tk::TList - Create and manipulate Tix Tabular List widgets</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::TList - Create and manipulate Tix Tabular List widgets</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="#superclass">SUPER-CLASS</A></LI>
- <LI><A HREF="#standard options">STANDARD OPTIONS</A></LI>
- <LI><A HREF="#widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></LI>
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <LI><A HREF="#display items">DISPLAY ITEMS</A></LI>
- <LI><A HREF="#widget methods">WIDGET METHODS</A></LI>
- <LI><A HREF="#bindings">BINDINGS</A></LI>
- <LI><A HREF="#example">EXAMPLE</A></LI>
- <LI><A HREF="#see also">SEE ALSO</A></LI>
- <LI><A HREF="#keywords">KEYWORDS</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>Tk::TList - Create and manipulate Tix Tabular List widgets</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>
- <P> <EM>$tlist</EM> = <EM>$parent</EM>-><STRONG>TList</STRONG>(?<EM>options</EM>?);</P>
- <P>
- <HR>
- <H1><A NAME="superclass">SUPER-CLASS</A></H1>
- <P>None.</P>
- <P>
- <HR>
- <H1><A NAME="standard options">STANDARD OPTIONS</A></H1>
- <P><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD><STRONG>-background</STRONG><TD><STRONG>-borderwidth</STRONG><TD><STRONG>-class</STRONG><TD><STRONG>-cursor</STRONG><TD><STRONG>-foreground</STRONG>
- <TR><TD><STRONG>-font</STRONG><TD><STRONG>-height</STRONG><TD><STRONG>-highlightcolor</STRONG><TD><STRONG>-highlightthickness</STRONG>
- <TR><TD><STRONG>-relief</STRONG><TD><STRONG>-selectbackground</STRONG><TD><STRONG>-selectforeground</STRONG>
- <TR><TD><STRONG>-xscrollcommand</STRONG><TD><STRONG>-yscrollcommand</STRONG><TD><STRONG>-width</STRONG></TABLE></P>
- <P>See <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for details of the standard options.</P>
- <P>
- <HR>
- <H1><A NAME="widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></H1>
- <DL>
- <DT><STRONG><A NAME="item_Name%3A_browsecmd">Name: <STRONG>browsecmd</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_BrowseCmd">Class: <STRONG>BrowseCmd</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dbrowsecmd">Switch: <STRONG>-browsecmd</STRONG></A></STRONG><BR>
- <DD>
- Specifies a perl/Tk <STRONG>callback</STRONG> to be executed when the user browses through the
- entries in the TList widget.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_command">Name: <STRONG>command</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Command">Class: <STRONG>Command</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dcommand">Switch: <STRONG>-command</STRONG></A></STRONG><BR>
- <DD>
- Specifies the perl/Tk <STRONG>callback</STRONG> to be executed when the user invokes a list
- entry in the TList widget. Normally the user invokes a list
- entry by double-clicking it or pressing the Return key.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_foreground">Name: <STRONG>foreground</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Foreground">Class: <STRONG>Foreground</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dforeground">Switch: <STRONG>-foreground</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Alias%3A_%2Dfg">Alias: <STRONG>-fg</STRONG></A></STRONG><BR>
- <DD>
- Specifies the default foreground color for the list entries.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_height">Name: <STRONG>height</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Height">Class: <STRONG>Height</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dheight">Switch: <STRONG>-height</STRONG></A></STRONG><BR>
- <DD>
- Specifies the desired height for the window in number of characters.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_itemType">Name: <STRONG>itemType</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_ItemType">Class: <STRONG>ItemType</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Ditemtype">Switch: <STRONG>-itemtype</STRONG></A></STRONG><BR>
- <DD>
- Specifies the default type of display item for this TList widget. When
- you call the <STRONG>insert</STRONG> methods, display items of this
- type will be created if the <STRONG>-itemtype</STRONG> option is not specified.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_orient">Name: <STRONG>orient</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Orient">Class: <STRONG>Orient</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dorient">Switch: <STRONG>-orient</STRONG></A></STRONG><BR>
- <DD>
- Specifies the order of tabularizing the list entries. When set to
- ``<STRONG>vertical</STRONG>'', the entries are arranged in a column, from top to
- bottom. If the entries cannot be contained in one column, the
- remaining entries will go to the next column, and so on. When set to
- ``<STRONG>horizontal</STRONG>'', the entries are arranged in a row, from left to
- right. If the entries cannot be contained in one row, the remaining
- entries will go to the next row, and so on.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_padX">Name: <STRONG>padX</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Pad">Class: <STRONG>Pad</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dpadx">Switch: <STRONG>-padx</STRONG></A></STRONG><BR>
- <DD>
- The default horizontal padding for list entries.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_padY">Name: <STRONG>padY</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG>Class: <STRONG>Pad</STRONG></STRONG><BR>
- <DD>
- <DT><STRONG>Switch: <STRONG>-padx</STRONG></STRONG><BR>
- <DD>
- The default vertical padding for list entries.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_selectBackground">Name: <STRONG>selectBackground</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_SelectBackground">Class: <STRONG>SelectBackground</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dselectbackground">Switch: <STRONG>-selectbackground</STRONG></A></STRONG><BR>
- <DD>
- Specifies the background color for the selected list entries.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_selectBorderWidth">Name: <STRONG>selectBorderWidth</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_BorderWidth">Class: <STRONG>BorderWidth</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dselectborderwidth">Switch: <STRONG>-selectborderwidth</STRONG></A></STRONG><BR>
- <DD>
- Specifies a non-negative value indicating the width of the 3-D border
- to draw around selected items. The value may have any of the forms
- acceptable to <STRONG>Tk_GetPixels</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_selectForeground">Name: <STRONG>selectForeground</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_SelectForeground">Class: <STRONG>SelectForeground</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dselectforeground">Switch: <STRONG>-selectforeground</STRONG></A></STRONG><BR>
- <DD>
- Specifies the foreground color for the selected list entries.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_selectMode">Name: <STRONG>selectMode</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_SelectMode">Class: <STRONG>SelectMode</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dselectmode">Switch: <STRONG>-selectmode</STRONG></A></STRONG><BR>
- <DD>
- Specifies one of several styles for manipulating the selection. The
- value of the option may be arbitrary, but the default bindings expect
- it to be either <STRONG>single</STRONG>, <STRONG>browse</STRONG>, <STRONG>multiple</STRONG>, or
- <STRONG>extended</STRONG>; the default value is <STRONG>single</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_sizeCmd">Name: <STRONG>sizeCmd</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_SizeCmd">Class: <STRONG>SizeCmd</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dsizecmd">Switch: <STRONG>-sizecmd</STRONG></A></STRONG><BR>
- <DD>
- Specifies a perl/Tk <STRONG>callback</STRONG> to be called whenever the TList widget
- changes its size. This command can be useful to implement ``user scroll
- bars when needed'' features.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_state">Name: <STRONG>state</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_State">Class: <STRONG>State</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dstate">Switch: <STRONG>-state</STRONG></A></STRONG><BR>
- <DD>
- Specifies whether the TList command should react to user actions. When
- set to ``<STRONG>normal</STRONG>'', the TList reacts to user actions in the normal
- way. When set to ``<STRONG>disabled</STRONG>'', the TList can only be scrolled, but
- its entries cannot be selected or activated.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_width">Name: <STRONG>width</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Width">Class: <STRONG>Width</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dwidth">Switch: <STRONG>-width</STRONG></A></STRONG><BR>
- <DD>
- Specifies the desired width for the window in characters.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>The <STRONG>TList</STRONG> method creates a new window (given by the
- $widget argument) and makes it into a TList widget.
- Additional options, described above, may be specified on the command
- line or in the option database to configure aspects of the
- TList widget such as its cursor and relief.</P>
- <P>The TList widget can be used to display data in a tabular format. The
- list entries of a TList widget are similar to the entries in the Tk
- listbox widget. The main differences are (1) the TList widget can
- display the list entries in a two dimensional format and (2) you can
- use graphical images as well as multiple colors and fonts for
- the list entries.</P>
- <P>Each list entry is identified by an <STRONG>index</STRONG>, which can be in the
- following forms:</P>
- <DL>
- <DT><STRONG><A NAME="item_number"><EM>number</EM></A></STRONG><BR>
- <DD>
- An integer that indicates the position of the entry in the list. 0
- means the first position, 1 means the second position, and so on.
- <P></P>
- <DT><STRONG><A NAME="item_end"><STRONG>end</STRONG></A></STRONG><BR>
- <DD>
- Indicates the end of the listbox. For some commands this means just
- after the last entry; for other commands it means the last entry.
- <P></P>
- <DT><STRONG><A NAME="item_%40x%2Cy"><STRONG>@</STRONG><EM>x</EM>,<EM>y</EM></A></STRONG><BR>
- <DD>
- Indicates the element that covers the point in the listbox window
- specified by x and y (in pixel coordinates). If no element covers that
- point, then the closest element to that point is used.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="display items">DISPLAY ITEMS</A></H1>
- <P>Each list entry in an TList widget is associated with a <STRONG>display</STRONG>
- item. The display item determines what visual information should
- be displayed for this list entry. Please see <A HREF="../../../site/lib/Tk/DItem.html">the Tk::DItem manpage</A>
- for a list of all display items.</P>
- <P>When a list entry is created by the <STRONG>insert</STRONG> command, the type of
- its display item is determined by the <STRONG>-itemtype</STRONG> option passed
- to these commands. If the <STRONG>-itemtype</STRONG> is omitted, then by default
- the type specified by this TList widget's <STRONG>-itemtype</STRONG> option is
- used.</P>
- <P>
- <HR>
- <H1><A NAME="widget methods">WIDGET METHODS</A></H1>
- <P>The <STRONG>TList</STRONG> method creates a widget object.</P>
- <P>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.
- The widget also inherits all the methods provided by the generic
- <A HREF="../../../site/lib/Tk/Widget.html">Tk::Widget</A> class.</P>
- <P>The following additional methods are available for TList widgets:</P>
- <DL>
- <DT><STRONG><A NAME="item_anchorSet"><EM>$tlist</EM>-><STRONG>anchorSet</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Sets the anchor to the list entry identified by <EM>index</EM>. The
- anchor is the end of the selection that is fixed while dragging out a
- selection with the mouse.
- <P></P>
- <DT><STRONG><A NAME="item_anchorClear"><EM>$tlist</EM>-><STRONG>anchorClear</STRONG></A></STRONG><BR>
- <DD>
- Removes the anchor, if any, from this TList widget. This only removes
- the surrounding highlights of the anchor entry and does not affect its
- selection status.
- <P></P>
- <DT><STRONG><A NAME="item_delete"><EM>$tlist</EM>-><STRONG>delete</STRONG>(<EM>from, </EM>?<EM>to</EM>?)</A></STRONG><BR>
- <DD>
- Deletes one or more list entries between the two entries specified by
- the indices <EM>from</EM> and <EM>to</EM>. If <EM>to</EM> is not specified, deletes
- the single entry specified by <EM>from</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_dragsiteSet"><EM>$tlist</EM>-><STRONG>dragsiteSet</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Sets the dragsite to the list entry identified by
- <EM>index</EM>. The dragsite is used to indicate the source of a
- drag-and-drop action. Currently drag-and-drop functionality has not
- been implemented in Tix yet.
- <P></P>
- <DT><STRONG><A NAME="item_dragsiteClear"><EM>$tlist</EM>-><STRONG>dragsiteClear</STRONG></A></STRONG><BR>
- <DD>
- Remove the dragsite, if any, from the this TList widget. This only
- removes the surrounding highlights of the dragsite entry and does not
- affect its selection status.
- <P></P>
- <DT><STRONG><A NAME="item_dropsiteSet"><EM>$tlist</EM>-><STRONG>dropsiteSet</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Sets the dropsite to the list entry identified by <EM>index</EM>. The
- dropsite is used to indicate the target of a drag-and-drop
- action. Currently drag-and-drop functionality has not been implemented
- in Tix yet.
- <P></P>
- <DT><STRONG><A NAME="item_dropsiteClear"><EM>$tlist</EM>-><STRONG>dropsiteClear</STRONG></A></STRONG><BR>
- <DD>
- Remove the dropsite, if any, from the this TList widget. This only
- removes the surrounding highlights of the dropsite entry and does not
- affect its selection status.
- <P></P>
- <DT><STRONG><A NAME="item_entrycget"><EM>$tlist</EM>-><STRONG>entrycget</STRONG>(<EM>index, option</EM>)</A></STRONG><BR>
- <DD>
- Returns the current value of the configuration option given by
- <EM>option</EM> for the entry indentfied by <EM>index</EM>. <EM>Option</EM> may
- have any of the values accepted by the <STRONG>insert</STRONG> method.
- <P></P>
- <DT><STRONG><A NAME="item_entryconfigure"><EM>$tlist</EM>-><STRONG>entryconfigure</STRONG>(<EM>index, </EM>?<EM>option</EM>?, <EM>?value, option, value, ...</EM>?)</A></STRONG><BR>
- <DD>
- Query or modify the configuration options of the list entry identified
- by <EM>index</EM>. If no <EM>option</EM> is specified, returns a list
- describing all of the available options for <EM>index</EM> (see
- <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of this list). If
- <EM>option</EM> is specified with no <EM>value</EM>, then the method
- returns a list describing the one named option (this list will be
- identical to the corresponding sublist of the value returned if no
- <EM>option</EM> is specified). If one or more <EM>option-value</EM> pairs
- are specified, then the command modifies the given <CODE>option(s)</CODE> to have
- the given value(s); in this case the method returns an empty string.
- <EM>Option</EM> may have any of the values accepted by the <STRONG>insert</STRONG>
- method. The exact set of options depends on the
- value of the <STRONG>-itemtype</STRONG> option passed to the the <STRONG>insert</STRONG>
- method when this list entry is created.
- <P></P>
- <DT><STRONG><A NAME="item_insert"><EM>$tlist</EM>-><STRONG>insert</STRONG>(<EM>index, </EM>?<EM>option, value, ...</EM>?)</A></STRONG><BR>
- <DD>
- Creates a new list entry at the position indicated by <EM>index</EM>. The
- following configuration options can be given to configure the list
- entry:
- <DL>
- <DT><STRONG><A NAME="item_%2Ditemtype_%3D%3E_type"><STRONG>-itemtype</STRONG> => <EM>type</EM></A></STRONG><BR>
- <DD>
- Specifies the type of display item to be display for the new list
- entry. <EM>type</EM> must be a valid display item type. Currently the
- available display item types are <STRONG>image</STRONG>, <STRONG>imagetext</STRONG>,
- <STRONG>text</STRONG>, and <EM>$widget</EM>. If this option is not specified, then by
- default the type specified by this TList widget's <STRONG>-itemtype</STRONG>
- option is used.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dstate_%3D%3E_state"><STRONG>-state</STRONG> => <EM>state</EM></A></STRONG><BR>
- <DD>
- Specifies whether this entry can be selected or invoked by the user.
- Must be either <STRONG>normal</STRONG> or <STRONG>disabled</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Ddata_%3D%3E_data"><STRONG>-data</STRONG> => <EM>data</EM></A></STRONG><BR>
- <DD>
- Arbitrary data to be associated with the entry (a perl scalar value).
- <P></P></DL>
- <P>The <STRONG>insert</STRONG> method accepts additional configuration options
- to configure the display item associated with this list entry. The set
- of additional configuration options depends on the type of the display
- item given by the <STRONG>-itemtype</STRONG> option. Please see
- <A HREF="../../../site/lib/Tk/DItem.html">the Tk::DItem manpage</A> for a list of the configuration options for
- each of the display item types.</P>
- <DT><STRONG><A NAME="item_info"><EM>$tlist</EM>-><STRONG>info</STRONG>(<EM>option, </EM><EM>arg, ...</EM>)</A></STRONG><BR>
- <DD>
- Query information about the TList widget. <EM>option</EM> can be one
- of the following:
- <DL>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>anchor, </STRONG><EM>index</EM>)</STRONG><BR>
- <DD>
- Returns the index of the current anchor, if any, of the TList
- widget. If the anchor is not set, returns the empty string.
- <P></P>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>dragsite, </STRONG><EM>index</EM>)</STRONG><BR>
- <DD>
- Returns the index of the current dragsite, if any, of the TList
- widget. If the dragsite is not set, returns the empty string.
- <P></P>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>dropsite, </STRONG><EM>index</EM>)</STRONG><BR>
- <DD>
- Returns the index of the current dropsite, if any, of the TList
- widget. If the dropsite is not set, returns the empty string.
- <P></P>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>selection</STRONG>)</STRONG><BR>
- <DD>
- Returns a list of selected elements in the TList widget. If no entries
- are selected, returns an empty string.
- <P></P></DL>
- <DT><STRONG><A NAME="item_nearest"><EM>$tlist</EM>-><STRONG>nearest</STRONG>(<EM>x, y</EM>)</A></STRONG><BR>
- <DD>
- Given an <EM>(x,y)</EM> coordinate within the TList window, this command
- returns the index of the TList element nearest to that coordinate.
- <P></P>
- <DT><STRONG><A NAME="item_see"><EM>$tlist</EM>-><STRONG>see</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Adjust the view in the TList so that the entry given by <EM>index</EM> is
- visible. If the entry is already visible then the command has no
- effect; otherwise TList scrolls to bring the element into view at the edge
- to which it is nearest.
- <P></P>
- <DT><STRONG><A NAME="item_selection"><EM>$tlist</EM>-><STRONG>selection</STRONG>(<EM>option, </EM><EM>arg, ...</EM>)</A></STRONG><BR>
- <DD>
- This command is used to adjust the selection within a TList widget. It
- has several forms, depending on <EM>option</EM>:
- <DL>
- <DT><STRONG><A NAME="item_selectionClear"><EM>$tlist</EM>-><STRONG>selectionClear</STRONG>(?<EM>from</EM>?, ?<EM>to</EM>?)</A></STRONG><BR>
- <DD>
- When no extra arguments are given, deselects all of the list <CODE>entrie(s)</CODE>
- in this TList widget. When only <EM>from</EM> is given, only the list
- entry identified by <EM>from</EM> is deselected. When both <EM>from</EM> and
- <EM>to</EM> are given, deselects all of the list <CODE>entrie(s)</CODE> between
- between <EM>from</EM> and <EM>to</EM>, inclusive, without affecting the
- selection state of entries outside that range.
- <P></P>
- <DT><STRONG><A NAME="item_selectionIncludes"><EM>$tlist</EM>-><STRONG>selectionIncludes</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Returns 1 if the list entry indicated by <EM>index</EM> is currently
- selected; returns 0 otherwise.
- <P></P>
- <DT><STRONG><A NAME="item_selectionSet"><EM>$tlist</EM>-><STRONG>selectionSet</STRONG>(<EM>from, </EM>?<EM>to</EM>?)</A></STRONG><BR>
- <DD>
- Selects all of the list <CODE>entrie(s)</CODE> between between <EM>from</EM> and
- <EM>to</EM>, inclusive, without affecting the selection state of entries
- outside that range. When only <EM>from</EM> is given, only the list entry
- identified by <EM>from</EM> is selected.
- <P></P></DL>
- <DT><STRONG><A NAME="item_xview"><EM>$tlist</EM>-><STRONG>xview</STRONG>(<EM>args</EM>)</A></STRONG><BR>
- <DD>
- This command is used to query and change the horizontal position of the
- information in the widget's window. It can take any of the following
- forms:
- <DL>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>xview</STRONG></STRONG><BR>
- <DD>
- Returns a list containing two elements. Each element is a real
- fraction between 0 and 1; together they describe the horizontal span
- that is visible in the window. For example, if the first element is
- 0.2 and the second element is 0.6, 20% of the TList entry is
- off-screen to the left, the middle 40% is visible in the window, and
- 40% of the entry is off-screen to the right. These are the same values
- passed to scrollbars via the <STRONG>-xscrollcommand</STRONG> option.
- <P></P>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>xview</STRONG>(<EM>index</EM>)</STRONG><BR>
- <DD>
- Adjusts the view in the window so that the list entry identified by
- <EM>index</EM> is aligned to the left edge of the window.
- <P></P>
- <DT><STRONG><A NAME="item_xviewMoveto"><EM>$tlist</EM>-><STRONG>xviewMoveto</STRONG>(<EM>fraction</EM>)</A></STRONG><BR>
- <DD>
- Adjusts the view in the window so that <EM>fraction</EM> of the total
- width of the TList is off-screen to the left. <EM>fraction</EM> must be
- a fraction between 0 and 1.
- <P></P>
- <DT><STRONG><A NAME="item_xviewScroll"><EM>$tlist</EM>-><STRONG>xviewScroll</STRONG>(<EM>number, what</EM>)</A></STRONG><BR>
- <DD>
- This command shifts the view in the window left or right according to
- <EM>number</EM> and <EM>what</EM>. <EM>Number</EM> must be an integer.
- <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG> or an
- abbreviation of one of these. If <EM>what</EM> is <STRONG>units</STRONG>, the view
- adjusts left or right by <EM>number</EM> character units (the width of
- the <STRONG>0</STRONG> character) on the display; if it is <STRONG>pages</STRONG> then the
- view adjusts by <EM>number</EM> screenfuls. If <EM>number</EM> is negative
- then characters farther to the left become visible; if it is positive
- then characters farther to the right become visible.
- <P></P></DL>
- <DT><STRONG><A NAME="item_yview"><EM>$tlist</EM>-><STRONG>yview</STRONG>(<EM>?args</EM>?)</A></STRONG><BR>
- <DD>
- This command is used to query and change the vertical position of the
- entries in the widget's window. It can take any of the following forms:
- <DL>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>yview</STRONG></STRONG><BR>
- <DD>
- Returns a list containing two elements, both of which are real
- fractions between 0 and 1. The first element gives the position of
- the list element at the top of the window, relative to the TList as a
- whole (0.5 means it is halfway through the TList, for example). The
- second element gives the position of the list entry just after the
- last one in the window, relative to the TList as a whole. These are
- the same values passed to scrollbars via the <STRONG>-yscrollcommand</STRONG>
- option.
- <P></P>
- <DT><STRONG><EM>$tlist</EM>-><STRONG>yview</STRONG>(<EM>index</EM>)</STRONG><BR>
- <DD>
- Adjusts the view in the window so that the list entry given by
- <EM>index</EM> is displayed at the top of the window.
- <P></P>
- <DT><STRONG><A NAME="item_yviewMoveto"><EM>$tlist</EM>-><STRONG>yviewMoveto</STRONG>(<EM>fraction</EM>)</A></STRONG><BR>
- <DD>
- Adjusts the view in the window so that the list entry given by
- <EM>fraction</EM> appears at the top of the window. <EM>Fraction</EM> is a
- fraction between 0 and 1; 0 indicates the first entry in the TList,
- 0.33 indicates the entry one-third the way through the TList, and so
- on.
- <P></P>
- <DT><STRONG><A NAME="item_yviewScroll"><EM>$tlist</EM>-><STRONG>yviewScroll</STRONG>(<EM>number, what</EM>)</A></STRONG><BR>
- <DD>
- This command adjust the view in the window up or down according to
- <EM>number</EM> and <EM>what</EM>. <EM>Number</EM> must be an integer.
- <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG>. If <EM>what</EM>
- is <STRONG>units</STRONG>, the view adjusts up or down by <EM>number</EM> lines; if
- it is <STRONG>pages</STRONG> then the view adjusts by <EM>number</EM> screenfuls.
- If <EM>number</EM> is negative then earlier entries become visible; if
- it is positive then later entries become visible.
- <P></P></DL>
- </DL>
- <P>
- <HR>
- <H1><A NAME="bindings">BINDINGS</A></H1>
- <DL>
- <DT><STRONG><A NAME="item_%5B1%5D">[1]</A></STRONG><BR>
- <DD>
- If the <STRONG>-selectmode</STRONG> is ``browse'', when the user drags the mouse
- pointer over the list entries, the entry under the pointer will be
- highlighted and the <STRONG>-browsecmd</STRONG> procedure will be called with
- one parameter, the index of the highlighted entry. Only one entry
- can be highlighted at a time. The <STRONG>-command</STRONG> procedure will be
- called when the user double-clicks on a list entry.
- <P></P>
- <DT><STRONG><A NAME="item_%5B2%5D">[2]</A></STRONG><BR>
- <DD>
- If the <STRONG>-selectmode</STRONG> is ``single'', the entries will only be
- highlighted by mouse <ButtonRelease-1> events. When a new list entry
- is highlighted, the <STRONG>-browsecmd</STRONG> procedure will be called with
- one parameter indicating the highlighted list entry. The
- <STRONG>-command</STRONG> procedure will be called when the user double-clicks
- on a list entry.
- <P></P>
- <DT><STRONG><A NAME="item_%5B3%5D">[3]</A></STRONG><BR>
- <DD>
- If the <STRONG>-selectmode</STRONG> is ``multiple'', when the user drags the mouse
- pointer over the list entries, all the entries under the pointer will
- be highlighted. However, only a contiguous region of list entries can
- be selected. When the highlighted area is changed, the
- <STRONG>-browsecmd</STRONG> procedure will be called with an undefined
- parameter. It is the responsibility of the <STRONG>-browsecmd</STRONG> procedure
- to find out the exact highlighted selection in the TList. The
- <STRONG>-command</STRONG> procedure will be called when the user double-clicks
- on a list entry.
- <P></P>
- <DT><STRONG><A NAME="item_%5B4%5D">[4]</A></STRONG><BR>
- <DD>
- If the <STRONG>-selectmode</STRONG> is ``extended'', when the user drags the mouse
- pointer over the list entries, all the entries under the pointer will
- be highlighted. The user can also make disjointed selections using
- <Control-ButtonPress-1>. When the highlighted area is changed, the
- <STRONG>-browsecmd</STRONG> procedure will be called with an undefined
- parameter. It is the responsibility of the <STRONG>-browsecmd</STRONG> procedure
- to find out the exact highlighted selection in the TList. The
- <STRONG>-command</STRONG> procedure will be called when the user double-clicks
- on a list entry.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="example">EXAMPLE</A></H1>
- <P>This example demonstrates how to use an TList to store a list of
- numbers:</P>
- <PRE>
- use strict;
- use Tk ();
- use Tk::TList;</PRE>
- <PRE>
- my $mw = Tk::MainWindow->new();
- my $image = $mw->Getimage('folder');
- my $tlist = $mw->TList(-orient => 'vertical');
- for my $text ( qw/one two three four five six seven eight nine/ ) {
- $tlist->insert('end',
- -itemtype=>'imagetext', -image=>$image, -text=>$text);
- }</PRE>
- <PRE>
- $tlist->pack(-expand=>'yes', -fill=>'both');</PRE>
- <PRE>
- Tk::MainLoop;</PRE>
- <P>
- <HR>
- <H1><A NAME="see also">SEE ALSO</A></H1>
- <P><A HREF="../../../site/lib/Tk/options.html">Tk::options</A>
- <A HREF="../../../site/lib/Tk/Widget.html">Tk::Widget</A>
- <A HREF="../../../site/lib/Tk/DItem.html">Tk::DItem</A>
- <A HREF="../../../site/lib/Tk/HList.html">Tk::HList</A>
- <A HREF="../../../site/lib/Tk/TixGrid.html">Tk::TixGrid</A></P>
- <P>
- <HR>
- <H1><A NAME="keywords">KEYWORDS</A></H1>
- <P>Tix(n), Tabular Listbox, Display Items</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::TList - Create and manipulate Tix Tabular List widgets</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-