home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _999995eb5d971d5f1c4cafbb29f98bab < prev    next >
Text File  |  2000-03-23  |  30KB  |  594 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Tk::TList - Create and manipulate Tix Tabular List widgets</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> Tk::TList - Create and manipulate Tix Tabular List widgets</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#superclass">SUPER-CLASS</A></LI>
  25.     <LI><A HREF="#standard options">STANDARD OPTIONS</A></LI>
  26.     <LI><A HREF="#widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></LI>
  27.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  28.     <LI><A HREF="#display items">DISPLAY ITEMS</A></LI>
  29.     <LI><A HREF="#widget methods">WIDGET METHODS</A></LI>
  30.     <LI><A HREF="#bindings">BINDINGS</A></LI>
  31.     <LI><A HREF="#example">EXAMPLE</A></LI>
  32.     <LI><A HREF="#see also">SEE ALSO</A></LI>
  33.     <LI><A HREF="#keywords">KEYWORDS</A></LI>
  34. </UL>
  35. <!-- INDEX END -->
  36.  
  37. <HR>
  38. <P>
  39. <H1><A NAME="name">NAME</A></H1>
  40. <P>Tk::TList - Create and manipulate Tix Tabular List widgets</P>
  41. <P>
  42. <HR>
  43. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  44. <UL>
  45. <LI>Linux</LI>
  46. <LI>Solaris</LI>
  47. <LI>Windows</LI>
  48. </UL>
  49. <HR>
  50. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  51. <P>    <EM>$tlist</EM> = <EM>$parent</EM>-><STRONG>TList</STRONG>(?<EM>options</EM>?);</P>
  52. <P>
  53. <HR>
  54. <H1><A NAME="superclass">SUPER-CLASS</A></H1>
  55. <P>None.</P>
  56. <P>
  57. <HR>
  58. <H1><A NAME="standard options">STANDARD OPTIONS</A></H1>
  59. <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>
  60. <TR><TD><STRONG>-font</STRONG><TD><STRONG>-height</STRONG><TD><STRONG>-highlightcolor</STRONG><TD><STRONG>-highlightthickness</STRONG>
  61. <TR><TD><STRONG>-relief</STRONG><TD><STRONG>-selectbackground</STRONG><TD><STRONG>-selectforeground</STRONG>
  62. <TR><TD><STRONG>-xscrollcommand</STRONG><TD><STRONG>-yscrollcommand</STRONG><TD><STRONG>-width</STRONG></TABLE></P>
  63. <P>See <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for details of the standard options.</P>
  64. <P>
  65. <HR>
  66. <H1><A NAME="widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></H1>
  67. <DL>
  68. <DT><STRONG><A NAME="item_Name%3A_browsecmd">Name:    <STRONG>browsecmd</STRONG></A></STRONG><BR>
  69. <DD>
  70. <DT><STRONG><A NAME="item_Class%3A_BrowseCmd">Class:    <STRONG>BrowseCmd</STRONG></A></STRONG><BR>
  71. <DD>
  72. <DT><STRONG><A NAME="item_Switch%3A_%2Dbrowsecmd">Switch:    <STRONG>-browsecmd</STRONG></A></STRONG><BR>
  73. <DD>
  74. Specifies a perl/Tk <STRONG>callback</STRONG> to be executed when the user browses through the
  75. entries in the TList widget.
  76. <P></P>
  77. <DT><STRONG><A NAME="item_Name%3A_command">Name:    <STRONG>command</STRONG></A></STRONG><BR>
  78. <DD>
  79. <DT><STRONG><A NAME="item_Class%3A_Command">Class:    <STRONG>Command</STRONG></A></STRONG><BR>
  80. <DD>
  81. <DT><STRONG><A NAME="item_Switch%3A_%2Dcommand">Switch:    <STRONG>-command</STRONG></A></STRONG><BR>
  82. <DD>
  83. Specifies the perl/Tk <STRONG>callback</STRONG> to be executed when the user invokes a list
  84. entry in the TList widget. Normally the user invokes a list
  85. entry by double-clicking it or pressing the Return key.
  86. <P></P>
  87. <DT><STRONG><A NAME="item_Name%3A_foreground">Name:    <STRONG>foreground</STRONG></A></STRONG><BR>
  88. <DD>
  89. <DT><STRONG><A NAME="item_Class%3A_Foreground">Class:    <STRONG>Foreground</STRONG></A></STRONG><BR>
  90. <DD>
  91. <DT><STRONG><A NAME="item_Switch%3A_%2Dforeground">Switch:    <STRONG>-foreground</STRONG></A></STRONG><BR>
  92. <DD>
  93. <DT><STRONG><A NAME="item_Alias%3A_%2Dfg">Alias:    <STRONG>-fg</STRONG></A></STRONG><BR>
  94. <DD>
  95. Specifies the default foreground color for the list entries.
  96. <P></P>
  97. <DT><STRONG><A NAME="item_Name%3A_height">Name:    <STRONG>height</STRONG></A></STRONG><BR>
  98. <DD>
  99. <DT><STRONG><A NAME="item_Class%3A_Height">Class:    <STRONG>Height</STRONG></A></STRONG><BR>
  100. <DD>
  101. <DT><STRONG><A NAME="item_Switch%3A_%2Dheight">Switch:    <STRONG>-height</STRONG></A></STRONG><BR>
  102. <DD>
  103. Specifies the desired height for the window in number of characters.
  104. <P></P>
  105. <DT><STRONG><A NAME="item_Name%3A_itemType">Name:    <STRONG>itemType</STRONG></A></STRONG><BR>
  106. <DD>
  107. <DT><STRONG><A NAME="item_Class%3A_ItemType">Class:    <STRONG>ItemType</STRONG></A></STRONG><BR>
  108. <DD>
  109. <DT><STRONG><A NAME="item_Switch%3A_%2Ditemtype">Switch:    <STRONG>-itemtype</STRONG></A></STRONG><BR>
  110. <DD>
  111. Specifies the default type of display item for this TList widget. When
  112. you call the <STRONG>insert</STRONG> methods, display items of this
  113. type will be created if the <STRONG>-itemtype</STRONG> option is not specified.
  114. <P></P>
  115. <DT><STRONG><A NAME="item_Name%3A_orient">Name:    <STRONG>orient</STRONG></A></STRONG><BR>
  116. <DD>
  117. <DT><STRONG><A NAME="item_Class%3A_Orient">Class:    <STRONG>Orient</STRONG></A></STRONG><BR>
  118. <DD>
  119. <DT><STRONG><A NAME="item_Switch%3A_%2Dorient">Switch:    <STRONG>-orient</STRONG></A></STRONG><BR>
  120. <DD>
  121. Specifies the order of tabularizing the list entries. When set to
  122. ``<STRONG>vertical</STRONG>'', the entries are arranged in a column, from top to
  123. bottom. If the entries cannot be contained in one column, the
  124. remaining entries will go to the next column, and so on. When set to
  125. ``<STRONG>horizontal</STRONG>'', the entries are arranged in a row, from left to
  126. right. If the entries cannot be contained in one row, the remaining
  127. entries will go to the next row, and so on.
  128. <P></P>
  129. <DT><STRONG><A NAME="item_Name%3A_padX">Name:    <STRONG>padX</STRONG></A></STRONG><BR>
  130. <DD>
  131. <DT><STRONG><A NAME="item_Class%3A_Pad">Class:    <STRONG>Pad</STRONG></A></STRONG><BR>
  132. <DD>
  133. <DT><STRONG><A NAME="item_Switch%3A_%2Dpadx">Switch:    <STRONG>-padx</STRONG></A></STRONG><BR>
  134. <DD>
  135. The default horizontal padding for list entries.
  136. <P></P>
  137. <DT><STRONG><A NAME="item_Name%3A_padY">Name:    <STRONG>padY</STRONG></A></STRONG><BR>
  138. <DD>
  139. <DT><STRONG>Class:    <STRONG>Pad</STRONG></STRONG><BR>
  140. <DD>
  141. <DT><STRONG>Switch:    <STRONG>-padx</STRONG></STRONG><BR>
  142. <DD>
  143. The default vertical padding for list entries.
  144. <P></P>
  145. <DT><STRONG><A NAME="item_Name%3A_selectBackground">Name:    <STRONG>selectBackground</STRONG></A></STRONG><BR>
  146. <DD>
  147. <DT><STRONG><A NAME="item_Class%3A_SelectBackground">Class:    <STRONG>SelectBackground</STRONG></A></STRONG><BR>
  148. <DD>
  149. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectbackground">Switch:    <STRONG>-selectbackground</STRONG></A></STRONG><BR>
  150. <DD>
  151. Specifies the background color for the selected list entries.
  152. <P></P>
  153. <DT><STRONG><A NAME="item_Name%3A_selectBorderWidth">Name:    <STRONG>selectBorderWidth</STRONG></A></STRONG><BR>
  154. <DD>
  155. <DT><STRONG><A NAME="item_Class%3A_BorderWidth">Class:    <STRONG>BorderWidth</STRONG></A></STRONG><BR>
  156. <DD>
  157. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectborderwidth">Switch:    <STRONG>-selectborderwidth</STRONG></A></STRONG><BR>
  158. <DD>
  159. Specifies a non-negative value indicating the width of the 3-D border
  160. to draw around selected items.  The value may have any of the forms
  161. acceptable to <STRONG>Tk_GetPixels</STRONG>.
  162. <P></P>
  163. <DT><STRONG><A NAME="item_Name%3A_selectForeground">Name:    <STRONG>selectForeground</STRONG></A></STRONG><BR>
  164. <DD>
  165. <DT><STRONG><A NAME="item_Class%3A_SelectForeground">Class:    <STRONG>SelectForeground</STRONG></A></STRONG><BR>
  166. <DD>
  167. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectforeground">Switch:    <STRONG>-selectforeground</STRONG></A></STRONG><BR>
  168. <DD>
  169. Specifies the foreground color for the selected list entries.
  170. <P></P>
  171. <DT><STRONG><A NAME="item_Name%3A_selectMode">Name:    <STRONG>selectMode</STRONG></A></STRONG><BR>
  172. <DD>
  173. <DT><STRONG><A NAME="item_Class%3A_SelectMode">Class:    <STRONG>SelectMode</STRONG></A></STRONG><BR>
  174. <DD>
  175. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectmode">Switch:    <STRONG>-selectmode</STRONG></A></STRONG><BR>
  176. <DD>
  177. Specifies one of several styles for manipulating the selection.  The
  178. value of the option may be arbitrary, but the default bindings expect
  179. it to be either <STRONG>single</STRONG>, <STRONG>browse</STRONG>, <STRONG>multiple</STRONG>, or
  180. <STRONG>extended</STRONG>; the default value is <STRONG>single</STRONG>.
  181. <P></P>
  182. <DT><STRONG><A NAME="item_Name%3A_sizeCmd">Name:    <STRONG>sizeCmd</STRONG></A></STRONG><BR>
  183. <DD>
  184. <DT><STRONG><A NAME="item_Class%3A_SizeCmd">Class:    <STRONG>SizeCmd</STRONG></A></STRONG><BR>
  185. <DD>
  186. <DT><STRONG><A NAME="item_Switch%3A_%2Dsizecmd">Switch:    <STRONG>-sizecmd</STRONG></A></STRONG><BR>
  187. <DD>
  188. Specifies a perl/Tk <STRONG>callback</STRONG> to be called whenever the TList widget
  189. changes its size. This command can be useful to implement ``user scroll
  190. bars when needed'' features.
  191. <P></P>
  192. <DT><STRONG><A NAME="item_Name%3A_state">Name:    <STRONG>state</STRONG></A></STRONG><BR>
  193. <DD>
  194. <DT><STRONG><A NAME="item_Class%3A_State">Class:    <STRONG>State</STRONG></A></STRONG><BR>
  195. <DD>
  196. <DT><STRONG><A NAME="item_Switch%3A_%2Dstate">Switch:    <STRONG>-state</STRONG></A></STRONG><BR>
  197. <DD>
  198. Specifies whether the TList command should react to user actions. When
  199. set to ``<STRONG>normal</STRONG>'', the TList reacts to user actions in the normal
  200. way. When set to ``<STRONG>disabled</STRONG>'', the TList can only be scrolled, but
  201. its entries cannot be selected or activated.
  202. <P></P>
  203. <DT><STRONG><A NAME="item_Name%3A_width">Name:    <STRONG>width</STRONG></A></STRONG><BR>
  204. <DD>
  205. <DT><STRONG><A NAME="item_Class%3A_Width">Class:    <STRONG>Width</STRONG></A></STRONG><BR>
  206. <DD>
  207. <DT><STRONG><A NAME="item_Switch%3A_%2Dwidth">Switch:    <STRONG>-width</STRONG></A></STRONG><BR>
  208. <DD>
  209. Specifies the desired width for the window in characters.
  210. <P></P></DL>
  211. <P>
  212. <HR>
  213. <H1><A NAME="description">DESCRIPTION</A></H1>
  214. <P>The <STRONG>TList</STRONG> method creates a new window (given by the
  215. $widget argument) and makes it into a TList widget.
  216. Additional options, described above, may be specified on the command
  217. line or in the option database to configure aspects of the
  218. TList widget such as its cursor and relief.</P>
  219. <P>The TList widget can be used to display data in a tabular format. The
  220. list entries of a TList widget are similar to the entries in the Tk
  221. listbox widget. The main differences are (1) the TList widget can
  222. display the list entries in a two dimensional format and (2) you can
  223. use graphical images as well as multiple colors and fonts for
  224. the list entries.</P>
  225. <P>Each list entry is identified by an <STRONG>index</STRONG>, which can be in the
  226. following forms:</P>
  227. <DL>
  228. <DT><STRONG><A NAME="item_number"><EM>number</EM></A></STRONG><BR>
  229. <DD>
  230. An integer that indicates the position of the entry in the list. 0
  231. means the first position, 1 means the second position, and so on.
  232. <P></P>
  233. <DT><STRONG><A NAME="item_end"><STRONG>end</STRONG></A></STRONG><BR>
  234. <DD>
  235. Indicates the end of the listbox. For some commands this means just
  236. after the last entry; for other commands it means the last entry.
  237. <P></P>
  238. <DT><STRONG><A NAME="item_%40x%2Cy"><STRONG>@</STRONG><EM>x</EM>,<EM>y</EM></A></STRONG><BR>
  239. <DD>
  240. Indicates the element that covers the point in the listbox window
  241. specified by x and y (in pixel coordinates). If no element covers that
  242. point, then the closest element to that point is used.
  243. <P></P></DL>
  244. <P>
  245. <HR>
  246. <H1><A NAME="display items">DISPLAY ITEMS</A></H1>
  247. <P>Each list entry in an TList widget is associated with a <STRONG>display</STRONG>
  248. item.  The display item determines what visual information should
  249. be displayed for this list entry. Please see <A HREF="../../../site/lib/Tk/DItem.html">the Tk::DItem manpage</A>
  250. for a list of all display items.</P>
  251. <P>When a list entry is created by the <STRONG>insert</STRONG> command, the type of
  252. its display item is determined by the <STRONG>-itemtype</STRONG> option passed
  253. to these commands. If the <STRONG>-itemtype</STRONG> is omitted, then by default
  254. the type specified by this TList widget's <STRONG>-itemtype</STRONG> option is
  255. used.</P>
  256. <P>
  257. <HR>
  258. <H1><A NAME="widget methods">WIDGET METHODS</A></H1>
  259. <P>The <STRONG>TList</STRONG> method creates a widget object.</P>
  260. <P>This object supports the <STRONG>configure</STRONG> and <STRONG>cget</STRONG> methods
  261. described in <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> which can be used to enquire and
  262. modify the options described above.
  263. The widget also inherits all the methods provided by the generic
  264. <A HREF="../../../site/lib/Tk/Widget.html">Tk::Widget</A> class.</P>
  265. <P>The following additional methods are available for TList widgets:</P>
  266. <DL>
  267. <DT><STRONG><A NAME="item_anchorSet"><EM>$tlist</EM>-><STRONG>anchorSet</STRONG>(<EM>index</EM>)</A></STRONG><BR>
  268. <DD>
  269. Sets the anchor to the list entry identified by <EM>index</EM>. The
  270. anchor is the end of the selection that is fixed while dragging out a
  271. selection with the mouse.
  272. <P></P>
  273. <DT><STRONG><A NAME="item_anchorClear"><EM>$tlist</EM>-><STRONG>anchorClear</STRONG></A></STRONG><BR>
  274. <DD>
  275. Removes the anchor, if any, from this TList widget. This only removes
  276. the surrounding highlights of the anchor entry and does not affect its
  277. selection status.
  278. <P></P>
  279. <DT><STRONG><A NAME="item_delete"><EM>$tlist</EM>-><STRONG>delete</STRONG>(<EM>from, </EM>?<EM>to</EM>?)</A></STRONG><BR>
  280. <DD>
  281. Deletes one or more list entries between the two entries specified by
  282. the indices <EM>from</EM> and <EM>to</EM>. If <EM>to</EM> is not specified, deletes
  283. the single entry specified by <EM>from</EM>.
  284. <P></P>
  285. <DT><STRONG><A NAME="item_dragsiteSet"><EM>$tlist</EM>-><STRONG>dragsiteSet</STRONG>(<EM>index</EM>)</A></STRONG><BR>
  286. <DD>
  287. Sets the dragsite to the list entry identified by
  288. <EM>index</EM>. The dragsite is used to indicate the source of a
  289. drag-and-drop action. Currently drag-and-drop functionality has not
  290. been implemented in Tix yet.
  291. <P></P>
  292. <DT><STRONG><A NAME="item_dragsiteClear"><EM>$tlist</EM>-><STRONG>dragsiteClear</STRONG></A></STRONG><BR>
  293. <DD>
  294. Remove the dragsite, if any, from the this TList widget. This only
  295. removes the surrounding highlights of the dragsite entry and does not
  296. affect its selection status.
  297. <P></P>
  298. <DT><STRONG><A NAME="item_dropsiteSet"><EM>$tlist</EM>-><STRONG>dropsiteSet</STRONG>(<EM>index</EM>)</A></STRONG><BR>
  299. <DD>
  300. Sets the dropsite to the list entry identified by <EM>index</EM>. The
  301. dropsite is used to indicate the target of a drag-and-drop
  302. action. Currently drag-and-drop functionality has not been implemented
  303. in Tix yet.
  304. <P></P>
  305. <DT><STRONG><A NAME="item_dropsiteClear"><EM>$tlist</EM>-><STRONG>dropsiteClear</STRONG></A></STRONG><BR>
  306. <DD>
  307. Remove the dropsite, if any, from the this TList widget. This only
  308. removes the surrounding highlights of the dropsite entry and does not
  309. affect its selection status.
  310. <P></P>
  311. <DT><STRONG><A NAME="item_entrycget"><EM>$tlist</EM>-><STRONG>entrycget</STRONG>(<EM>index, option</EM>)</A></STRONG><BR>
  312. <DD>
  313. Returns the current value of the configuration option given by
  314. <EM>option</EM> for the entry indentfied by <EM>index</EM>. <EM>Option</EM> may
  315. have any of the values accepted by the <STRONG>insert</STRONG> method.
  316. <P></P>
  317. <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>
  318. <DD>
  319. Query or modify the configuration options of the list entry identified
  320. by <EM>index</EM>. If no <EM>option</EM> is specified, returns a list
  321. describing all of the available options for <EM>index</EM> (see
  322. <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of this list). If
  323. <EM>option</EM> is specified with no <EM>value</EM>, then the method
  324. returns a list describing the one named option (this list will be
  325. identical to the corresponding sublist of the value returned if no
  326. <EM>option</EM> is specified). If one or more <EM>option-value</EM> pairs
  327. are specified, then the command modifies the given <CODE>option(s)</CODE> to have
  328. the given value(s); in this case the method returns an empty string.
  329. <EM>Option</EM> may have any of the values accepted by the <STRONG>insert</STRONG>
  330. method. The exact set of options depends on the
  331. value of the <STRONG>-itemtype</STRONG> option passed to the the <STRONG>insert</STRONG>
  332. method when this list entry is created.
  333. <P></P>
  334. <DT><STRONG><A NAME="item_insert"><EM>$tlist</EM>-><STRONG>insert</STRONG>(<EM>index, </EM>?<EM>option, value, ...</EM>?)</A></STRONG><BR>
  335. <DD>
  336. Creates a new list entry at the position indicated by <EM>index</EM>. The
  337. following configuration options can be given to configure the list
  338. entry:
  339. <DL>
  340. <DT><STRONG><A NAME="item_%2Ditemtype_%3D%3E_type"><STRONG>-itemtype</STRONG> => <EM>type</EM></A></STRONG><BR>
  341. <DD>
  342. Specifies the type of display item to be display for the new list
  343. entry. <EM>type</EM> must be a valid display item type. Currently the
  344. available display item types are <STRONG>image</STRONG>, <STRONG>imagetext</STRONG>,
  345. <STRONG>text</STRONG>, and <EM>$widget</EM>. If this option is not specified, then by
  346. default the type specified by this TList widget's <STRONG>-itemtype</STRONG>
  347. option is used.
  348. <P></P>
  349. <DT><STRONG><A NAME="item_%2Dstate_%3D%3E_state"><STRONG>-state</STRONG> => <EM>state</EM></A></STRONG><BR>
  350. <DD>
  351. Specifies whether this entry can be selected or invoked by the user.
  352. Must be either <STRONG>normal</STRONG> or <STRONG>disabled</STRONG>.
  353. <P></P>
  354. <DT><STRONG><A NAME="item_%2Ddata_%3D%3E_data"><STRONG>-data</STRONG> => <EM>data</EM></A></STRONG><BR>
  355. <DD>
  356. Arbitrary data to be associated with the entry (a perl scalar value).
  357. <P></P></DL>
  358. <P>The <STRONG>insert</STRONG> method accepts additional configuration options
  359. to configure the display item associated with this list entry. The set
  360. of additional configuration options depends on the type of the display
  361. item given by the <STRONG>-itemtype</STRONG> option. Please see
  362. <A HREF="../../../site/lib/Tk/DItem.html">the Tk::DItem manpage</A> for a list of the configuration options for
  363. each of the display item types.</P>
  364. <DT><STRONG><A NAME="item_info"><EM>$tlist</EM>-><STRONG>info</STRONG>(<EM>option, </EM><EM>arg, ...</EM>)</A></STRONG><BR>
  365. <DD>
  366. Query information about the TList widget. <EM>option</EM> can be one
  367. of the following:
  368. <DL>
  369. <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>anchor, </STRONG><EM>index</EM>)</STRONG><BR>
  370. <DD>
  371. Returns the index of the current anchor, if any, of the TList
  372. widget. If the anchor is not set, returns the empty string.
  373. <P></P>
  374. <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>dragsite, </STRONG><EM>index</EM>)</STRONG><BR>
  375. <DD>
  376. Returns the index of the current dragsite, if any, of the TList
  377. widget. If the dragsite is not set, returns the empty string.
  378. <P></P>
  379. <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>dropsite, </STRONG><EM>index</EM>)</STRONG><BR>
  380. <DD>
  381. Returns the index of the current dropsite, if any, of the TList
  382. widget. If the dropsite is not set, returns the empty string.
  383. <P></P>
  384. <DT><STRONG><EM>$tlist</EM>-><STRONG>info</STRONG>(<STRONG>selection</STRONG>)</STRONG><BR>
  385. <DD>
  386. Returns a list of selected elements in the TList widget. If no entries
  387. are selected, returns an empty string.
  388. <P></P></DL>
  389. <DT><STRONG><A NAME="item_nearest"><EM>$tlist</EM>-><STRONG>nearest</STRONG>(<EM>x, y</EM>)</A></STRONG><BR>
  390. <DD>
  391. Given an <EM>(x,y)</EM> coordinate within the TList window, this command
  392. returns the index of the TList element nearest to that coordinate.
  393. <P></P>
  394. <DT><STRONG><A NAME="item_see"><EM>$tlist</EM>-><STRONG>see</STRONG>(<EM>index</EM>)</A></STRONG><BR>
  395. <DD>
  396. Adjust the view in the TList so that the entry given by <EM>index</EM> is
  397. visible. If the entry is already visible then the command has no
  398. effect; otherwise TList scrolls to bring the element into view at the edge
  399. to which it is nearest.
  400. <P></P>
  401. <DT><STRONG><A NAME="item_selection"><EM>$tlist</EM>-><STRONG>selection</STRONG>(<EM>option, </EM><EM>arg, ...</EM>)</A></STRONG><BR>
  402. <DD>
  403. This command is used to adjust the selection within a TList widget. It
  404. has several forms, depending on <EM>option</EM>:
  405. <DL>
  406. <DT><STRONG><A NAME="item_selectionClear"><EM>$tlist</EM>-><STRONG>selectionClear</STRONG>(?<EM>from</EM>?, ?<EM>to</EM>?)</A></STRONG><BR>
  407. <DD>
  408. When no extra arguments are given, deselects all of the list <CODE>entrie(s)</CODE>
  409. in this TList widget. When only <EM>from</EM> is given, only the list
  410. entry identified by <EM>from</EM> is deselected. When both <EM>from</EM> and
  411. <EM>to</EM> are given, deselects all of the list <CODE>entrie(s)</CODE> between
  412. between <EM>from</EM> and <EM>to</EM>, inclusive, without affecting the
  413. selection state of entries outside that range.
  414. <P></P>
  415. <DT><STRONG><A NAME="item_selectionIncludes"><EM>$tlist</EM>-><STRONG>selectionIncludes</STRONG>(<EM>index</EM>)</A></STRONG><BR>
  416. <DD>
  417. Returns 1 if the list entry indicated by <EM>index</EM> is currently
  418. selected; returns 0 otherwise.
  419. <P></P>
  420. <DT><STRONG><A NAME="item_selectionSet"><EM>$tlist</EM>-><STRONG>selectionSet</STRONG>(<EM>from, </EM>?<EM>to</EM>?)</A></STRONG><BR>
  421. <DD>
  422. Selects all of the list <CODE>entrie(s)</CODE> between between <EM>from</EM> and
  423. <EM>to</EM>, inclusive, without affecting the selection state of entries
  424. outside that range. When only <EM>from</EM> is given, only the list entry
  425. identified by <EM>from</EM> is selected.
  426. <P></P></DL>
  427. <DT><STRONG><A NAME="item_xview"><EM>$tlist</EM>-><STRONG>xview</STRONG>(<EM>args</EM>)</A></STRONG><BR>
  428. <DD>
  429. This command is used to query and change the horizontal position of the
  430. information in the widget's window. It can take any of the following
  431. forms:
  432. <DL>
  433. <DT><STRONG><EM>$tlist</EM>-><STRONG>xview</STRONG></STRONG><BR>
  434. <DD>
  435. Returns a list containing two elements.  Each element is a real
  436. fraction between 0 and 1; together they describe the horizontal span
  437. that is visible in the window.  For example, if the first element is
  438. 0.2 and the second element is 0.6, 20% of the TList entry is
  439. off-screen to the left, the middle 40% is visible in the window, and
  440. 40% of the entry is off-screen to the right. These are the same values
  441. passed to scrollbars via the <STRONG>-xscrollcommand</STRONG> option.
  442. <P></P>
  443. <DT><STRONG><EM>$tlist</EM>-><STRONG>xview</STRONG>(<EM>index</EM>)</STRONG><BR>
  444. <DD>
  445. Adjusts the view in the window so that the list entry identified by
  446. <EM>index</EM> is aligned to the left edge of the window.
  447. <P></P>
  448. <DT><STRONG><A NAME="item_xviewMoveto"><EM>$tlist</EM>-><STRONG>xviewMoveto</STRONG>(<EM>fraction</EM>)</A></STRONG><BR>
  449. <DD>
  450. Adjusts the view in the window so that <EM>fraction</EM> of the total
  451. width of the TList is off-screen to the left. <EM>fraction</EM> must be
  452. a fraction between 0 and 1.
  453. <P></P>
  454. <DT><STRONG><A NAME="item_xviewScroll"><EM>$tlist</EM>-><STRONG>xviewScroll</STRONG>(<EM>number, what</EM>)</A></STRONG><BR>
  455. <DD>
  456. This command shifts the view in the window left or right according to
  457. <EM>number</EM> and <EM>what</EM>. <EM>Number</EM> must be an integer.
  458. <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG> or an
  459. abbreviation of one of these. If <EM>what</EM> is <STRONG>units</STRONG>, the view
  460. adjusts left or right by <EM>number</EM> character units (the width of
  461. the <STRONG>0</STRONG> character) on the display; if it is <STRONG>pages</STRONG> then the
  462. view adjusts by <EM>number</EM> screenfuls. If <EM>number</EM> is negative
  463. then characters farther to the left become visible; if it is positive
  464. then characters farther to the right become visible.
  465. <P></P></DL>
  466. <DT><STRONG><A NAME="item_yview"><EM>$tlist</EM>-><STRONG>yview</STRONG>(<EM>?args</EM>?)</A></STRONG><BR>
  467. <DD>
  468. This command is used to query and change the vertical position of the
  469. entries in the widget's window. It can take any of the following forms:
  470. <DL>
  471. <DT><STRONG><EM>$tlist</EM>-><STRONG>yview</STRONG></STRONG><BR>
  472. <DD>
  473. Returns a list containing two elements, both of which are real
  474. fractions between 0 and 1.  The first element gives the position of
  475. the list element at the top of the window, relative to the TList as a
  476. whole (0.5 means it is halfway through the TList, for example).  The
  477. second element gives the position of the list entry just after the
  478. last one in the window, relative to the TList as a whole.  These are
  479. the same values passed to scrollbars via the <STRONG>-yscrollcommand</STRONG>
  480. option.
  481. <P></P>
  482. <DT><STRONG><EM>$tlist</EM>-><STRONG>yview</STRONG>(<EM>index</EM>)</STRONG><BR>
  483. <DD>
  484. Adjusts the view in the window so that the list entry given by
  485. <EM>index</EM> is displayed at the top of the window.
  486. <P></P>
  487. <DT><STRONG><A NAME="item_yviewMoveto"><EM>$tlist</EM>-><STRONG>yviewMoveto</STRONG>(<EM>fraction</EM>)</A></STRONG><BR>
  488. <DD>
  489. Adjusts the view in the window so that the list entry given by
  490. <EM>fraction</EM> appears at the top of the window. <EM>Fraction</EM> is a
  491. fraction between 0 and 1; 0 indicates the first entry in the TList,
  492. 0.33 indicates the entry one-third the way through the TList, and so
  493. on.
  494. <P></P>
  495. <DT><STRONG><A NAME="item_yviewScroll"><EM>$tlist</EM>-><STRONG>yviewScroll</STRONG>(<EM>number, what</EM>)</A></STRONG><BR>
  496. <DD>
  497. This command adjust the view in the window up or down according to
  498. <EM>number</EM> and <EM>what</EM>.  <EM>Number</EM> must be an integer.
  499. <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG>.  If <EM>what</EM>
  500. is <STRONG>units</STRONG>, the view adjusts up or down by <EM>number</EM> lines; if
  501. it is <STRONG>pages</STRONG> then the view adjusts by <EM>number</EM> screenfuls.
  502. If <EM>number</EM> is negative then earlier entries become visible; if
  503. it is positive then later entries become visible.
  504. <P></P></DL>
  505. </DL>
  506. <P>
  507. <HR>
  508. <H1><A NAME="bindings">BINDINGS</A></H1>
  509. <DL>
  510. <DT><STRONG><A NAME="item_%5B1%5D">[1]</A></STRONG><BR>
  511. <DD>
  512. If the <STRONG>-selectmode</STRONG> is ``browse'', when the user drags the mouse
  513. pointer over the list entries, the entry under the pointer will be
  514. highlighted and the <STRONG>-browsecmd</STRONG> procedure will be called with
  515. one parameter, the index of the highlighted entry. Only one entry
  516. can be highlighted at a time. The <STRONG>-command</STRONG> procedure will be
  517. called when the user double-clicks on a list entry.
  518. <P></P>
  519. <DT><STRONG><A NAME="item_%5B2%5D">[2]</A></STRONG><BR>
  520. <DD>
  521. If the <STRONG>-selectmode</STRONG> is ``single'', the entries will only be
  522. highlighted by mouse <ButtonRelease-1> events. When a new list entry
  523. is highlighted, the <STRONG>-browsecmd</STRONG> procedure will be called with
  524. one parameter indicating the highlighted list entry. The
  525. <STRONG>-command</STRONG> procedure will be called when the user double-clicks
  526. on a list entry.
  527. <P></P>
  528. <DT><STRONG><A NAME="item_%5B3%5D">[3]</A></STRONG><BR>
  529. <DD>
  530. If the <STRONG>-selectmode</STRONG> is ``multiple'', when the user drags the mouse
  531. pointer over the list entries, all the entries under the pointer will
  532. be highlighted. However, only a contiguous region of list entries can
  533. be selected. When the highlighted area is changed, the
  534. <STRONG>-browsecmd</STRONG> procedure will be called with an undefined
  535. parameter. It is the responsibility of the <STRONG>-browsecmd</STRONG> procedure
  536. to find out the exact highlighted selection in the TList. The
  537. <STRONG>-command</STRONG> procedure will be called when the user double-clicks
  538. on a list entry.
  539. <P></P>
  540. <DT><STRONG><A NAME="item_%5B4%5D">[4]</A></STRONG><BR>
  541. <DD>
  542. If the <STRONG>-selectmode</STRONG> is ``extended'', when the user drags the mouse
  543. pointer over the list entries, all the entries under the pointer will
  544. be highlighted. The user can also make disjointed selections using
  545. <Control-ButtonPress-1>. When the highlighted area is changed, the
  546. <STRONG>-browsecmd</STRONG> procedure will be called with an undefined
  547. parameter. It is the responsibility of the <STRONG>-browsecmd</STRONG> procedure
  548. to find out the exact highlighted selection in the TList. The
  549. <STRONG>-command</STRONG> procedure will be called when the user double-clicks
  550. on a list entry.
  551. <P></P></DL>
  552. <P>
  553. <HR>
  554. <H1><A NAME="example">EXAMPLE</A></H1>
  555. <P>This example demonstrates how to use an TList to store a list of
  556. numbers:</P>
  557. <PRE>
  558.     use strict;
  559.     use Tk ();
  560.     use Tk::TList;</PRE>
  561. <PRE>
  562.     my $mw = Tk::MainWindow->new();
  563.     my $image = $mw->Getimage('folder');
  564.     my $tlist = $mw->TList(-orient => 'vertical');
  565.     for my $text ( qw/one two three four five six seven eight nine/ ) {
  566.         $tlist->insert('end',
  567.                  -itemtype=>'imagetext', -image=>$image, -text=>$text);
  568.     }</PRE>
  569. <PRE>
  570.     $tlist->pack(-expand=>'yes', -fill=>'both');</PRE>
  571. <PRE>
  572.     Tk::MainLoop;</PRE>
  573. <P>
  574. <HR>
  575. <H1><A NAME="see also">SEE ALSO</A></H1>
  576. <P><A HREF="../../../site/lib/Tk/options.html">Tk::options</A>
  577. <A HREF="../../../site/lib/Tk/Widget.html">Tk::Widget</A>
  578. <A HREF="../../../site/lib/Tk/DItem.html">Tk::DItem</A>
  579. <A HREF="../../../site/lib/Tk/HList.html">Tk::HList</A>
  580. <A HREF="../../../site/lib/Tk/TixGrid.html">Tk::TixGrid</A></P>
  581. <P>
  582. <HR>
  583. <H1><A NAME="keywords">KEYWORDS</A></H1>
  584. <P>Tix(n), Tabular Listbox, Display Items</P>
  585. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  586. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  587. <STRONG><P CLASS=block> Tk::TList - Create and manipulate Tix Tabular List widgets</P></STRONG>
  588. </TD></TR>
  589. </TABLE>
  590.  
  591. </BODY>
  592.  
  593. </HTML>
  594.