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

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Tk::HList - Create and manipulate Tix Hierarchial 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::HList - Create and manipulate Tix Hierarchial 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="#standard options">STANDARD OPTIONS</A></LI>
  25.     <LI><A HREF="#widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></LI>
  26.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  27.     <LI><A HREF="#display items">DISPLAY ITEMS</A></LI>
  28.     <LI><A HREF="#widget methods">WIDGET METHODS</A></LI>
  29.     <LI><A HREF="#bindings">BINDINGS</A></LI>
  30.     <LI><A HREF="#example">EXAMPLE</A></LI>
  31.     <LI><A HREF="#bugs">BUGS</A></LI>
  32.     <LI><A HREF="#keywords">KEYWORDS</A></LI>
  33.     <LI><A HREF="#see also">SEE ALSO</A></LI>
  34. </UL>
  35. <!-- INDEX END -->
  36.  
  37. <HR>
  38. <P>
  39. <H1><A NAME="name">NAME</A></H1>
  40. <P>Tk::HList - Create and manipulate Tix Hierarchial 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>$hlist</EM> = <EM>$parent</EM>-><STRONG>HList</STRONG>(?<EM>options</EM>?);</P>
  52. <P>
  53. <HR>
  54. <H1><A NAME="standard options">STANDARD OPTIONS</A></H1>
  55. <P><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD><STRONG>-background</STRONG><TD><STRONG>-borderwidth</STRONG><TD><STRONG>-cursor</STRONG><TD><STRONG>-exportselection</STRONG>
  56. <TR><TD><STRONG>-foreground</STRONG><TD><STRONG>-font</STRONG><TD><STRONG>-height</STRONG><TD><STRONG>-highlightcolor</STRONG>
  57. <TR><TD><STRONG>-highlightthickness</STRONG><TD><STRONG>-relief</STRONG><TD><STRONG>-selectbackground</STRONG>
  58. <TR><TD><STRONG>-selectforeground</STRONG><TD><STRONG>-xscrollcommand</STRONG><TD><STRONG>-yscrollcommand</STRONG>
  59. <TR><TD><STRONG>-width</STRONG></TABLE></P>
  60. <P>See <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for details of the standard options.</P>
  61. <P>
  62. <HR>
  63. <H1><A NAME="widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></H1>
  64. <DL>
  65. <DT><STRONG><A NAME="item_Name%3A_browsecmd">Name:    <STRONG>browsecmd</STRONG></A></STRONG><BR>
  66. <DD>
  67. <DT><STRONG><A NAME="item_Class%3A_BrowseCmd">Class:    <STRONG>BrowseCmd</STRONG></A></STRONG><BR>
  68. <DD>
  69. <DT><STRONG><A NAME="item_Switch%3A_%2Dbrowsecmd">Switch:    <STRONG>-browsecmd</STRONG></A></STRONG><BR>
  70. <DD>
  71. Specifies a perl/Tk <A HREF="../../../site/lib/Tk/callbacks.html">callback</A> to be executed when the user browses through the
  72. entries in the HList widget.
  73. <P></P>
  74. <DT><STRONG><A NAME="item_Name%3A_columns">Name:    <STRONG>columns</STRONG></A></STRONG><BR>
  75. <DD>
  76. <DT><STRONG><A NAME="item_Class%3A_Columns">Class:    <STRONG>Columns</STRONG></A></STRONG><BR>
  77. <DD>
  78. <DT><STRONG><A NAME="item_Switch%3A_%2Dcolumns">Switch:    <STRONG>-columns</STRONG></A></STRONG><BR>
  79. <DD>
  80. Specifies the number of columns in this HList widget. This option can
  81. only be set during the creation of the HList widget and cannot be
  82. changed subsequently.
  83. <P></P>
  84. <DT><STRONG><A NAME="item_Name%3A_command">Name:    <STRONG>command</STRONG></A></STRONG><BR>
  85. <DD>
  86. <DT><STRONG><A NAME="item_Class%3A_Command">Class:    <STRONG>Command</STRONG></A></STRONG><BR>
  87. <DD>
  88. <DT><STRONG><A NAME="item_Switch%3A_%2Dcommand">Switch:    <STRONG>-command</STRONG></A></STRONG><BR>
  89. <DD>
  90. Specifies the perl/Tk <A HREF="../../../site/lib/Tk/callbacks.html">callback</A> to be executed when the user invokes a list
  91. entry in the HList widget. Normally the user invokes a list
  92. entry by double-clicking it or pressing the Return key.
  93. <P></P>
  94. <DT><STRONG><A NAME="item_Name%3A_drawBranch">Name:    <STRONG>drawBranch</STRONG></A></STRONG><BR>
  95. <DD>
  96. <DT><STRONG><A NAME="item_Class%3A_DrawBranch">Class:    <STRONG>DrawBranch</STRONG></A></STRONG><BR>
  97. <DD>
  98. <DT><STRONG><A NAME="item_Switch%3A_%2Ddrawbranch">Switch:    <STRONG>-drawbranch</STRONG></A></STRONG><BR>
  99. <DD>
  100. A Boolean value to specify whether branch line should be drawn to
  101. connect list entries to their parents.
  102. <P></P>
  103. <DT><STRONG><A NAME="item_Name%3A_foreground">Name:    <STRONG>foreground</STRONG></A></STRONG><BR>
  104. <DD>
  105. <DT><STRONG><A NAME="item_Class%3A_Foreground">Class:    <STRONG>Foreground</STRONG></A></STRONG><BR>
  106. <DD>
  107. <DT><STRONG><A NAME="item_Switch%3A_%2Dforeground">Switch:    <STRONG>-foreground</STRONG></A></STRONG><BR>
  108. <DD>
  109. <DT><STRONG><A NAME="item_Alias%3A_%2Dfg">Alias:    <STRONG>-fg</STRONG></A></STRONG><BR>
  110. <DD>
  111. <STRONG>[OBSOLETE]</STRONG> Specifies the default foreground color for the list entries.
  112. <P></P>
  113. <DT><STRONG><A NAME="item_Name%3A_gap">Name:    <STRONG>gap</STRONG></A></STRONG><BR>
  114. <DD>
  115. <DT><STRONG><A NAME="item_Class%3A_Gap">Class:    <STRONG>Gap</STRONG></A></STRONG><BR>
  116. <DD>
  117. <DT><STRONG><A NAME="item_Switch%3A_%2Dgap">Switch:    <STRONG>-gap</STRONG></A></STRONG><BR>
  118. <DD>
  119. <STRONG>[OBSOLETE]</STRONG> The default distance between the bitmap/image and the
  120. text in list entries.
  121. <P></P>
  122. <DT><STRONG><A NAME="item_Name%3A_header">Name:    <STRONG>header</STRONG></A></STRONG><BR>
  123. <DD>
  124. <DT><STRONG><A NAME="item_Class%3A_Header">Class:    <STRONG>Header</STRONG></A></STRONG><BR>
  125. <DD>
  126. <DT><STRONG><A NAME="item_Switch%3A_%2Dheader">Switch:    <STRONG>-header</STRONG></A></STRONG><BR>
  127. <DD>
  128. A Boolean value specifying whether headers should be displayed for
  129. this HList widget (see the <STRONG>header</STRONG> method below).
  130. <P></P>
  131. <DT><STRONG><A NAME="item_Name%3A_height">Name:    <STRONG>height</STRONG></A></STRONG><BR>
  132. <DD>
  133. <DT><STRONG><A NAME="item_Class%3A_Height">Class:    <STRONG>Height</STRONG></A></STRONG><BR>
  134. <DD>
  135. <DT><STRONG><A NAME="item_Switch%3A_%2Dheight">Switch:    <STRONG>-height</STRONG></A></STRONG><BR>
  136. <DD>
  137. Specifies the desired height for the window in number of characters.
  138. <P></P>
  139. <DT><STRONG><A NAME="item_Name%3A_indent">Name:    <STRONG>indent</STRONG></A></STRONG><BR>
  140. <DD>
  141. <DT><STRONG><A NAME="item_Class%3A_Indent">Class:    <STRONG>Indent</STRONG></A></STRONG><BR>
  142. <DD>
  143. <DT><STRONG><A NAME="item_Switch%3A_%2Dindent">Switch:    <STRONG>-indent</STRONG></A></STRONG><BR>
  144. <DD>
  145. Specifies the amount of horizontal indentation between a list entry
  146. and its children. Must be a valid screen distance value.
  147. <P></P>
  148. <DT><STRONG><A NAME="item_Name%3A_indicator">Name:    <STRONG>indicator</STRONG></A></STRONG><BR>
  149. <DD>
  150. <DT><STRONG><A NAME="item_Class%3A_Indicator">Class:    <STRONG>Indicator</STRONG></A></STRONG><BR>
  151. <DD>
  152. <DT><STRONG><A NAME="item_Switch%3A_%2Dindicator">Switch:    <STRONG>-indicator</STRONG></A></STRONG><BR>
  153. <DD>
  154. Specifies whether the indicators should be displayed inside the HList
  155. widget. See the <STRONG>indicator</STRONG> method below.
  156. <P></P>
  157. <DT><STRONG><A NAME="item_Name%3A_indicatorCmd">Name:    <STRONG>indicatorCmd</STRONG></A></STRONG><BR>
  158. <DD>
  159. <DT><STRONG><A NAME="item_Class%3A_IndicatorCmd">Class:    <STRONG>IndicatorCmd</STRONG></A></STRONG><BR>
  160. <DD>
  161. <DT><STRONG><A NAME="item_Switch%3A_%2Dindicatorcmd">Switch:    <STRONG>-indicatorcmd</STRONG></A></STRONG><BR>
  162. <DD>
  163. Specifies a perl/Tk <A HREF="../../../site/lib/Tk/callbacks.html">callback</A> to be executed when the user manipulates the
  164. indicator of an HList entry. The <STRONG>-indicatorcmd</STRONG> is triggered
  165. when the user press or releases the mouse button over the indicator in
  166. an HList entry. By default the perl/Tk <STRONG>callback</STRONG> specified by
  167. <STRONG>-indicatorcmd</STRONG> is executed with two additional arguments, the
  168. entryPath of the entry whose indicator has been triggered and additional
  169. information about the event.  The additional information is one of the
  170. following strings:  <STRONG><Arm></STRONG>, <STRONG><Disarm></STRONG>,
  171. and <STRONG><Activate></STRONG>.
  172. <P></P>
  173. <DT><STRONG><A NAME="item_Name%3A_itemType">Name:    <STRONG>itemType</STRONG></A></STRONG><BR>
  174. <DD>
  175. <DT><STRONG><A NAME="item_Class%3A_ItemType">Class:    <STRONG>ItemType</STRONG></A></STRONG><BR>
  176. <DD>
  177. <DT><STRONG><A NAME="item_Switch%3A_%2Ditemtype">Switch:    <STRONG>-itemtype</STRONG></A></STRONG><BR>
  178. <DD>
  179. Specifies the default type of display item for this HList widget. When
  180. you call the <STRONG>itemCreate</STRONG>, <STRONG>add</STRONG> and <STRONG>addchild</STRONG> methods, display
  181. items of this
  182. type will be created if the <STRONG>-itemtype</STRONG> option is not specified .
  183. <P></P>
  184. <DT><STRONG><A NAME="item_Name%3A_padX">Name:    <STRONG>padX</STRONG></A></STRONG><BR>
  185. <DD>
  186. <DT><STRONG><A NAME="item_Class%3A_Pad">Class:    <STRONG>Pad</STRONG></A></STRONG><BR>
  187. <DD>
  188. <DT><STRONG><A NAME="item_Switch%3A_%2Dpadx">Switch:    <STRONG>-padx</STRONG></A></STRONG><BR>
  189. <DD>
  190. <STRONG>[OBSOLETE]</STRONG> The default horizontal padding for list entries.
  191. <P></P>
  192. <DT><STRONG><A NAME="item_Name%3A_padY">Name:    <STRONG>padY</STRONG></A></STRONG><BR>
  193. <DD>
  194. <DT><STRONG>Class:    <STRONG>Pad</STRONG></STRONG><BR>
  195. <DD>
  196. <DT><STRONG>Switch:    <STRONG>-padx</STRONG></STRONG><BR>
  197. <DD>
  198. <STRONG>[OBSOLETE]</STRONG> The default vertical padding for list entries.
  199. <P></P>
  200. <DT><STRONG><A NAME="item_Name%3A_selectBackground">Name:    <STRONG>selectBackground</STRONG></A></STRONG><BR>
  201. <DD>
  202. <DT><STRONG><A NAME="item_Class%3A_SelectBackground">Class:    <STRONG>SelectBackground</STRONG></A></STRONG><BR>
  203. <DD>
  204. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectbackground">Switch:    <STRONG>-selectbackground</STRONG></A></STRONG><BR>
  205. <DD>
  206. Specifies the background color for the selected list entries.
  207. <P></P>
  208. <DT><STRONG><A NAME="item_Name%3A_selectBorderWidth">Name:    <STRONG>selectBorderWidth</STRONG></A></STRONG><BR>
  209. <DD>
  210. <DT><STRONG><A NAME="item_Class%3A_BorderWidth">Class:    <STRONG>BorderWidth</STRONG></A></STRONG><BR>
  211. <DD>
  212. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectborderwidth">Switch:    <STRONG>-selectborderwidth</STRONG></A></STRONG><BR>
  213. <DD>
  214. Specifies a non-negative value indicating the width of the 3-D border
  215. to draw around selected items.  The value may have any of the forms
  216. acceptable to <STRONG>Tk_GetPixels</STRONG>.
  217. <P></P>
  218. <DT><STRONG><A NAME="item_Name%3A_selectForeground">Name:    <STRONG>selectForeground</STRONG></A></STRONG><BR>
  219. <DD>
  220. <DT><STRONG><A NAME="item_Class%3A_SelectForeground">Class:    <STRONG>SelectForeground</STRONG></A></STRONG><BR>
  221. <DD>
  222. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectforeground">Switch:    <STRONG>-selectforeground</STRONG></A></STRONG><BR>
  223. <DD>
  224. Specifies the foreground color for the selected list entries.
  225. <P></P>
  226. <DT><STRONG><A NAME="item_Name%3A_selectMode">Name:    <STRONG>selectMode</STRONG></A></STRONG><BR>
  227. <DD>
  228. <DT><STRONG><A NAME="item_Class%3A_SelectMode">Class:    <STRONG>SelectMode</STRONG></A></STRONG><BR>
  229. <DD>
  230. <DT><STRONG><A NAME="item_Switch%3A_%2Dselectmode">Switch:    <STRONG>-selectmode</STRONG></A></STRONG><BR>
  231. <DD>
  232. Specifies one of several styles for manipulating the selection.  The
  233. value of the option may be arbitrary, but the default bindings expect
  234. it to be either <STRONG>single</STRONG>, <STRONG>browse</STRONG>, <STRONG>multiple</STRONG>, or
  235. <STRONG>extended</STRONG>; the default value is <STRONG>single</STRONG>.
  236. <P></P>
  237. <DT><STRONG><A NAME="item_Name%3A_sizeCmd">Name:    <STRONG>sizeCmd</STRONG></A></STRONG><BR>
  238. <DD>
  239. <DT><STRONG><A NAME="item_Class%3A_SizeCmd">Class:    <STRONG>SizeCmd</STRONG></A></STRONG><BR>
  240. <DD>
  241. <DT><STRONG><A NAME="item_Switch%3A_%2Dsizecmd">Switch:    <STRONG>-sizecmd</STRONG></A></STRONG><BR>
  242. <DD>
  243. Specifies a perl/Tk <A HREF="../../../site/lib/Tk/callbacks.html">callback</A> to be called whenever the HList widget
  244. changes its size.  This method can be useful to implement ``<EM>user scroll
  245. bars when needed</EM>'' features.
  246. <P></P>
  247. <DT><STRONG><A NAME="item_Name%3A_separator">Name:    <STRONG>separator</STRONG></A></STRONG><BR>
  248. <DD>
  249. <DT><STRONG><A NAME="item_Class%3A_Separator">Class:    <STRONG>Separator</STRONG></A></STRONG><BR>
  250. <DD>
  251. <DT><STRONG><A NAME="item_Switch%3A_%2Dseparator">Switch:    <STRONG>-separator</STRONG></A></STRONG><BR>
  252. <DD>
  253. Specifies the character to used as the separator character when
  254. intepreting the path-names of list entries. By default the character
  255. ``.'' is used.
  256. <P></P>
  257. <DT><STRONG><A NAME="item_Name%3A_width">Name:    <STRONG>width</STRONG></A></STRONG><BR>
  258. <DD>
  259. <DT><STRONG><A NAME="item_Class%3A_Width">Class:    <STRONG>Width</STRONG></A></STRONG><BR>
  260. <DD>
  261. <DT><STRONG><A NAME="item_Switch%3A_%2Dwidth">Switch:    <STRONG>-width</STRONG></A></STRONG><BR>
  262. <DD>
  263. Specifies the desired width for the window in characters.
  264. <P></P></DL>
  265. <P>
  266. <HR>
  267. <H1><A NAME="description">DESCRIPTION</A></H1>
  268. <P>The <STRONG>HList</STRONG> method creates a new window (given by the
  269. $widget argument) and makes it into a HList widget.
  270. Additional options, described above, may be specified on the command
  271. line or in the option database to configure aspects of the
  272. HList widget such as its cursor and relief.</P>
  273. <P>The HList widget can be used to display any data that have a
  274. hierarchical structure, for example, file system directory trees. The
  275. list entries are indented and connected by branch lines according to
  276. their places in the hierachy.</P>
  277. <P>Each list entry is identified by an <STRONG>entryPath</STRONG>. The entryPath is a
  278. sequence of <STRONG>entry names</STRONG> separated by the separator charactor
  279. (specified by the <STRONG>-separator</STRONG> option). An <STRONG>entry name</STRONG> can be
  280. any string that does not contain the separator charactor, or it can be
  281. the a string that contains only one separator charactor.</P>
  282. <P>For example, when ``.'' is used as the separator charactor,
  283. ``one.two.three'' is the entryPath for a list entry whose parent is
  284. ``one.two'', whose parent is ``one'', which is a toplevel entry (has no
  285. parents).</P>
  286. <P>Another examples: ``.two.three'' is the entryPath for a list entry whose
  287. parent is ``.two'', whose parent is ``.'', which is a toplevel entry.</P>
  288. <P>
  289. <HR>
  290. <H1><A NAME="display items">DISPLAY ITEMS</A></H1>
  291. <P>Each list entry in an HList widget is associated with a <STRONG>display</STRONG>
  292. item.  The display item determines what visual information should
  293. be displayed for this list entry. Please see <A HREF="../../../site/lib/Tk/DItem.html">the Tk::DItem manpage</A>
  294. for a list of all display items.
  295. When a list entry is created by the <STRONG>itemCreate</STRONG>, <STRONG>add</STRONG> or
  296. <STRONG>addchild</STRONG> widget
  297. methods, the type of its display item is determined by the
  298. <STRONG>-itemtype</STRONG> option passed to these methods. If the
  299. <STRONG>-itemtype</STRONG> is omitted, then by default the type specified by
  300. this HList widget's <STRONG>-itemtype</STRONG> option is used.</P>
  301. <P>
  302. <HR>
  303. <H1><A NAME="widget methods">WIDGET METHODS</A></H1>
  304. <P>The <STRONG>HList</STRONG> method creates a widget object.
  305. This object supports the <STRONG>configure</STRONG> and <STRONG>cget</STRONG> methods
  306. described in <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> which can be used to enquire and
  307. modify the options described above.
  308. The widget also inherits all the methods provided by the generic
  309. <A HREF="../../../site/lib/Tk/Widget.html">Tk::Widget</A> class.</P>
  310. <P>The following additional methods are available HList widgets:</P>
  311. <DL>
  312. <DT><STRONG><A NAME="item_add"><EM>$hlist</EM>-><STRONG>add</STRONG>(<EM>$entryPath</EM> ?,<EM>option</EM>=><EM>value</EM>, ...?)</A></STRONG><BR>
  313. <DD>
  314. Creates a new list entry with the pathname <EM>$entryPath</EM>. A list
  315. entry must be created after its parent is created (unless this entry
  316. is a top-level entry, which has no parent).  See also <A HREF="#bugs">BUGS</A> below.
  317. This method returns the
  318. entryPath of the newly created list entry. The following
  319. configuration options can be given to configure the list entry:
  320. <DL>
  321. <DT><STRONG><A NAME="item_%2Dat_%3D%3E_position"><STRONG>-at</STRONG> => <EM>position</EM></A></STRONG><BR>
  322. <DD>
  323. Insert the new list at the position given by <EM>position</EM>.
  324. <EM>position</EM> must be a valid integer. The position <STRONG>0</STRONG> indicates
  325. the first position, <STRONG>1</STRONG> indicates the second position, and so on.
  326. <P></P>
  327. <DT><STRONG><A NAME="item_%2Dafter_%3D%3E_afterWhich"><STRONG>-after</STRONG> => <EM>afterWhich</EM></A></STRONG><BR>
  328. <DD>
  329. Insert the new list entry after the entry identified by
  330. <EM>afterWhich</EM>. <EM>afterWhich</EM> must be a valid list entry and it
  331. mush have the same parent as the new list entry
  332. <P></P>
  333. <DT><STRONG><A NAME="item_%2Dbefore_%3D%3E_beforeWhich"><STRONG>-before</STRONG> => <EM>beforeWhich</EM></A></STRONG><BR>
  334. <DD>
  335. Insert the new list entry before the entry identified by
  336. <EM>beforeWhich</EM>. <EM>beforeWhich</EM> must be a valid list entry and it
  337. mush have the same parent as the new list entry
  338. <P></P>
  339. <DT><STRONG><A NAME="item_%2Ddata_%3D%3E_string"><STRONG>-data</STRONG> => <EM>string</EM></A></STRONG><BR>
  340. <DD>
  341. Specifies a string to associate with this list entry. This string can
  342. be queried by the <STRONG>info</STRONG> method. The application
  343. programmer can use the <STRONG>-data</STRONG> option to associate the list entry
  344. with the data it represents.
  345. <P></P>
  346. <DT><STRONG><A NAME="item_%2Ditemtype_%3D%3E_type"><STRONG>-itemtype</STRONG> => <EM>type</EM></A></STRONG><BR>
  347. <DD>
  348. Specifies the type of display item to be display for the new list
  349. entry. <STRONG>type</STRONG> must be a valid display item type. Currently the
  350. available display item types are <STRONG>imagetext</STRONG>, <STRONG>text</STRONG>, and
  351. $widget. If this option is not specified, then by default the
  352. type specified by this HList widget's <STRONG>-itemtype</STRONG> option is used.
  353. <P></P>
  354. <DT><STRONG><A NAME="item_%2Dstate_%3D%3E_state"><STRONG>-state</STRONG> => <EM>state</EM></A></STRONG><BR>
  355. <DD>
  356. Specifies whether this entry can be selected or invoked by the user.
  357. Must be either <STRONG>normal</STRONG> or <STRONG>disabled</STRONG>.
  358. <P></P></DL>
  359. <P>The <STRONG>add</STRONG> method accepts additional configuration options
  360. to configure the display item associated with this list entry. The set
  361. of additional configuration options depends on the type of the display
  362. item given by the <STRONG>-itemtype</STRONG> option. Please see
  363. <A HREF="../../../site/lib/Tk/DItem.html">the Tk::DItem manpage</A> for a list of the configuration options for
  364. each of the display item types.</P>
  365. <DT><STRONG><A NAME="item_addchild"><EM>$hlist</EM>-><STRONG>addchild</STRONG>(<EM>$parentPath, </EM>?<EM>option, value, ..., </EM>?)</A></STRONG><BR>
  366. <DD>
  367. Adds a new child entry to the children list of the list entry
  368. identified by <EM>$parentPath</EM>. Or, if <EM>$parentPath</EM> is set to be
  369. the empty string, then creates a new toplevel entry. The name of the
  370. new list entry will be a unique name automatically generated by the
  371. HList widget. Usually if <EM>$parentPath</EM> is <STRONG>foo</STRONG>, then the
  372. entryPath of the new entry will be <STRONG>foo.0</STRONG>, <STRONG>foo.1</STRONG>, ... etc.
  373. This method returns the entryPath of the newly created list entry.
  374. <EM>option</EM> can be any option for the <STRONG>add</STRONG> method.
  375. See also <A HREF="#bugs">BUGS</A> below.
  376. <P></P>
  377. <DT><STRONG><A NAME="item_anchorSet"><EM>$hlist</EM>-><STRONG>anchorSet</STRONG>(<EM>$entryPath</EM>)</A></STRONG><BR>
  378. <DD>
  379. Sets the anchor to the list entry identified by <EM>$entryPath</EM>.  The
  380. anchor is the end of the selection that is fixed while the user is
  381. dragging out a selection with the mouse.
  382. <P></P>
  383. <DT><STRONG><A NAME="item_anchorClear"><EM>$hlist</EM>-><STRONG>anchorClear</STRONG></A></STRONG><BR>
  384. <DD>
  385. Removes the anchor, if any, from this HList widget. This only
  386. removes the surrounding highlights of the anchor entry and does not
  387. affect its selection status.
  388. <P></P>
  389. <DT><STRONG><A NAME="item_columnWidth"><EM>$hlist</EM>-><STRONG>columnWidth</STRONG>(<EM>$col</EM>?, <EM>-char</EM>?, ?<EM>width</EM>?)</A></STRONG><BR>
  390. <DD>
  391. Querys or sets the width of a the column <EM>$col</EM> in the HList
  392. widget. The value of <EM>$col</EM> is zero-based: 0 stands for the first
  393. column, 1 stands for the second, and so on. If no further parameters
  394. are given, returns the current width of this column (in number of
  395. pixels). Additional parameters can be given to set the width of this
  396. column:
  397. <DL>
  398. <DT><STRONG><EM>$hlist</EM>-><STRONG>columnWidth</STRONG>(<EM>$col</EM>, <STRONG>''</STRONG>)</STRONG><BR>
  399. <DD>
  400. An empty string indicates that the width of the column should be just
  401. wide enough to display the widest element in this column. In this
  402. case, the width of this column may change as a result of the elements
  403. in this column changing their sizes.
  404. <P></P>
  405. <DT><STRONG><EM>$hlist</EM>-><STRONG>columnWidth</STRONG>(<EM>$col, </EM><EM>width</EM>)</STRONG><BR>
  406. <DD>
  407. <EM>width</EM> must be in a form accepted by <STRONG>Tk_GetPixels</STRONG>.
  408. <P></P>
  409. <DT><STRONG><EM>$hlist</EM>-><STRONG>columnWidth</STRONG>(<EM>$col, </EM><STRONG>-char, </STRONG><EM>nChars</EM>)</STRONG><BR>
  410. <DD>
  411. The width is set to be the average width occupied by <EM>nChars</EM>
  412. number of characters of the font specified by the <STRONG>-font</STRONG> option
  413. of this HList widget.
  414. <P></P></DL>
  415. <DT><STRONG><A NAME="item_delete"><EM>$hlist</EM>-><STRONG>delete</STRONG>(<EM>option</EM>, <EM>$entryPath</EM>)</A></STRONG><BR>
  416. <DD>
  417. Delete one or more list entries. <EM>option</EM> may be one of the
  418. following:
  419. <DL>
  420. <DT><STRONG><A NAME="item_all"><STRONG>all</STRONG></A></STRONG><BR>
  421. <DD>
  422. Delete all entries in the HList. In this case the <EM>$entryPath</EM>
  423. does not need to be specified.
  424. <P></P>
  425. <DT><STRONG><A NAME="item_entry"><STRONG>entry</STRONG></A></STRONG><BR>
  426. <DD>
  427. Delete the entry specified by <EM>$entryPath</EM> and all its offsprings,
  428. if any.
  429. <P></P>
  430. <DT><STRONG><A NAME="item_offsprings"><STRONG>offsprings</STRONG></A></STRONG><BR>
  431. <DD>
  432. Delete all the offsprings, if any, of the entry specified by
  433. <EM>$entryPath</EM>. However, <EM>$entryPath</EM> itself is not deleted.
  434. <P></P>
  435. <DT><STRONG><A NAME="item_siblings"><STRONG>siblings</STRONG></A></STRONG><BR>
  436. <DD>
  437. Delete all the list entries that share the same parent with the entry
  438. specified by <EM>$entryPath</EM>. However, <EM>$entryPath</EM> itself is not
  439. deleted.
  440. <P></P></DL>
  441. <DT><STRONG><A NAME="item_dragsiteSet"><EM>$hlist</EM>-><STRONG>dragsiteSet</STRONG>(<EM>$entryPath</EM>)</A></STRONG><BR>
  442. <DD>
  443. Sets the dragsite to the list entry identified by
  444. <EM>$entryPath</EM>. The dragsite is used to indicate the source of a
  445. drag-and-drop action. Currently drag-and-drop functionality has not
  446. been implemented in Tix yet.
  447. <P></P>
  448. <DT><STRONG><A NAME="item_dragsiteClear"><EM>$hlist</EM>-><STRONG>dragsiteClear</STRONG></A></STRONG><BR>
  449. <DD>
  450. Remove the dragsite, if any, from the this HList widget. This only
  451. removes the surrounding highlights of the dragsite entry and does not
  452. affect its selection status.
  453. <P></P>
  454. <DT><STRONG><A NAME="item_dropsiteSet"><EM>$hlist</EM>-><STRONG>dropsiteSet</STRONG>(<EM>$entryPath</EM>)</A></STRONG><BR>
  455. <DD>
  456. Sets the dropsite to the list entry identified by <EM>$entryPath</EM>. The
  457. dropsite is used to indicate the target of a drag-and-drop
  458. action. Currently drag-and-drop functionality has not been implemented
  459. in Tix yet.
  460. <P></P>
  461. <DT><STRONG><A NAME="item_dropsiteClear"><EM>$hlist</EM>-><STRONG>dropsiteClear</STRONG></A></STRONG><BR>
  462. <DD>
  463. Remove the dropsite, if any, from the this HList widget. This only
  464. removes the surrounding highlights of the dropsite entry and does not
  465. affect its selection status.
  466. <P></P>
  467. <DT><STRONG><A NAME="item_entrycget"><EM>$hlist</EM>-><STRONG>entrycget</STRONG>(<EM>$entryPath</EM>, <EM>option</EM>)</A></STRONG><BR>
  468. <DD>
  469. Returns the current value of the configuration option given by
  470. <EM>option</EM> for the entry indentfied by <EM>$entryPath</EM>. <EM>Option</EM>
  471. may have any of the values accepted by the <STRONG>add</STRONG> method.
  472. <P></P>
  473. <DT><STRONG><A NAME="item_entryconfigure"><EM>$hlist</EM>-><STRONG>entryconfigure</STRONG>(<EM>$entryPath</EM> ?,<EM>option</EM>?, ?<EM>value</EM>=><EM>option</EM>, ...?)</A></STRONG><BR>
  474. <DD>
  475. Query or modify the configuration options of the list entry indentfied
  476. by <EM>$entryPath</EM>. If no <EM>option</EM> is specified, returns a list
  477. describing all of the available options for <EM>$entryPath</EM> (see
  478. <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for information on the format of this list.) If
  479. <EM>option</EM> is specified with no <EM>value</EM>, then the method
  480. returns a list describing the one named option (this list will be
  481. identical to the corresponding sublist of the value returned if no
  482. <EM>option</EM> is specified). If one or more <EM>option-value</EM> pairs
  483. are specified, then the method modifies the given <CODE>option(s)</CODE> to have
  484. the given value(s); in this case the method returns an empty string.
  485. <EM>Option</EM> may have any of the values accepted by the <STRONG>add</STRONG> or
  486. <STRONG>addchild</STRONG> method. The exact set of options depends on the
  487. value of the <STRONG>-itemtype</STRONG> option passed to the the <STRONG>add</STRONG> or
  488. <STRONG>addchild</STRONG> method when this list entry is created.
  489. <P></P>
  490. <DT><STRONG><A NAME="item_header"><EM>$hlist</EM>-><STRONG>header</STRONG>(<EM>option</EM>, <EM>$col</EM> ?,<EM>args</EM>, ...?)</A></STRONG><BR>
  491. <DD>
  492. Manipulates the header items of this HList widget. If the
  493. <STRONG>-header</STRONG> option of this HList widget is set to true, then a
  494. header item is displayed at the top of each column. The <EM>$col</EM>
  495. argument for this method must be a valid integer. 0 indicates the
  496. first column, 1 the second column, ... and so on. This method
  497. supports the following options:
  498. <DL>
  499. <DT><STRONG><EM>$hlist</EM>-><STRONG>header</STRONG>(<STRONG>cget</STRONG>, <EM>$col</EM>, <EM>option</EM>)</STRONG><BR>
  500. <DD>
  501. If the <EM>$col</EM>-th column has a header display item, returns the
  502. value of the specified <EM>option</EM> of the header item. If the header
  503. doesn't exist, returns an error.
  504. <P></P>
  505. <DT><STRONG><EM>$hlist</EM>-><STRONG>header</STRONG>(<STRONG>configure, </STRONG><EM>$col, </EM>?<EM>option</EM>?, <EM>?value, option, value, ...</EM>?)</STRONG><BR>
  506. <DD>
  507. Query or modify the configuration options of the header display item
  508. of the <EM>$col</EM>-th column. The header item must exist, or an error
  509. will result.  If no <EM>option</EM> is specified, returns a list
  510. describing all of the available options for the header display item
  511. (see <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for information on the format of this
  512. list.) If <EM>option</EM> is specified with no <EM>value</EM>, then the
  513. method returns a list describing the one named option (this list will
  514. be identical to the corresponding sublist of the value returned if no
  515. <EM>option</EM> is specified). If one or more <EM>option-value</EM> pairs
  516. are specified, then the method modifies the given <CODE>option(s)</CODE> to have
  517. the given value(s); in this case the method returns an empty
  518. string. <EM>Option</EM> may have any of the values accepted by the
  519. <STRONG>header create</STRONG> method. The exact set of options depends
  520. on the value of the <STRONG>-itemtype</STRONG> option passed to the the <STRONG>header</STRONG>
  521. create method when this display item was created.
  522. <P></P>
  523. <DT><STRONG><EM>$hlist</EM>-><STRONG>header</STRONG>(<STRONG>create, </STRONG><EM>$col, </EM>?<EM>-itemtype type</EM>? ?<EM>option value ...</EM>?</STRONG><BR>
  524. <DD>
  525. Creates a new display item as the header for the <EM>$col</EM>-th
  526. column. See also <A HREF="#bugs">BUGS</A> below.
  527. If an header display item already exists for this column, it
  528. will be replaced by the new item.  An optional parameter
  529. <EM>-itemtype</EM> can be used to specify what type of display item
  530. should be created. If the <EM>-itemtype</EM> is not given, then by
  531. default the type specified by this HList widget's <STRONG>-itemtype</STRONG>
  532. option is used. Additional parameters, in <EM>option-value</EM> pairs,
  533. can be passed to configure the appearance of the display item. Each
  534. <EM>option-value</EM> pair must be a valid option for this type of
  535. display item or one of the following:
  536. <DL>
  537. <DT><STRONG><A NAME="item_%2Dborderwidth_%3D%3E_color"><STRONG>-borderwidth</STRONG> => <EM>color</EM></A></STRONG><BR>
  538. <DD>
  539. Specifies the border width of this header item.
  540. <P></P>
  541. <DT><STRONG><A NAME="item_%2Dheaderbackground_%3D%3E_color"><STRONG>-headerbackground</STRONG> => <EM>color</EM></A></STRONG><BR>
  542. <DD>
  543. Specifies the background color of this header item.
  544. <P></P>
  545. <DT><STRONG><A NAME="item_%2Drelief_%3D%3E_type"><STRONG>-relief</STRONG> => <EM>type</EM></A></STRONG><BR>
  546. <DD>
  547. Specifies the relief type of the border of this header item.
  548. <P></P></DL>
  549. <DT><STRONG><EM>$hlist</EM>-><STRONG>header</STRONG>(<STRONG>delete, </STRONG><EM>$col</EM>)</STRONG><BR>
  550. <DD>
  551. Deletes the header display item for the <EM>$col</EM>-th column.
  552. <P></P>
  553. <DT><STRONG><EM>$hlist</EM>-><STRONG>header</STRONG>(<STRONG>exists, </STRONG><EM>$col</EM>)</STRONG><BR>
  554. <DD>
  555. Return true if an header display item exists for the <EM>$col</EM>-th
  556. column; return false otherwise.
  557. <P></P>
  558. <DT><STRONG><EM>$hlist</EM>-><STRONG>header</STRONG>(<STRONG>size</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  559. <DD>
  560. If an header display item exists for the <EM>$col</EM>-th column , returns
  561. its size in pixels in a two element list <EM>(width, height)</EM>;
  562. returns an error if the header display item does not exist.
  563. <P></P></DL>
  564. <DT><STRONG><A NAME="item_hide"><EM>$hlist</EM>-><STRONG>hide</STRONG>(<EM>option</EM> ?,<EM>$entryPath</EM>?)</A></STRONG><BR>
  565. <DD>
  566. Makes some of entries invisible without deleting them.
  567. <EM>Option</EM> can be one of the following:
  568. <DL>
  569. <DT><STRONG><STRONG>entry</STRONG></STRONG><BR>
  570. <DD>
  571. Hides the list entry identified by <EM>$entryPath</EM>.
  572. <P></P></DL>
  573. <P>Currently only the <STRONG>entry</STRONG> option is supported. Other options will
  574. be added in the next release.</P>
  575. <DT><STRONG><A NAME="item_indicator"><EM>$hlist</EM>-><STRONG>indicator</STRONG>(<EM>option</EM>, <EM>$entryPath</EM>, ?<EM>args, ...</EM>?)</A></STRONG><BR>
  576. <DD>
  577. Manipulates the indicator on the list entries. An indicator is usually
  578. a small display item (such as an image) that is displayed to the left
  579. to an entry to indicate the status of the entry.  For example, it may
  580. be used to indicate whether a directory is opened or
  581. closed.  <EM>Option</EM> can be one of the following:
  582. <DL>
  583. <DT><STRONG><EM>$hlist</EM>-><STRONG>indicator</STRONG>(<STRONG>cget</STRONG>, <EM>$entryPath</EM>, <EM>option</EM>)</STRONG><BR>
  584. <DD>
  585. If the list entry given by <EM>$entryPath</EM> has an indicator, returns
  586. the value of the specified <EM>option</EM> of the indicator. If the
  587. indicator doesn't exist, returns an error.
  588. <P></P>
  589. <DT><STRONG><EM>$hlist</EM>-><STRONG>indicator</STRONG>(<STRONG>configure</STRONG>, <EM>$entryPath</EM>, ?<EM>option</EM>?, <EM>?value, option, value, ...</EM>?)</STRONG><BR>
  590. <DD>
  591. Query or modify the configuration options of the indicator display
  592. item of the entry specified by <EM>$entryPath</EM>. The indicator item
  593. must exist, or an error will result.  If no <EM>option</EM> is specified,
  594. returns a list describing all of the available options for the
  595. indicator display item (see <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for information
  596. on the format of this list). If <EM>option</EM> is specified with no
  597. <EM>value</EM>, then the method returns a list describing the one named
  598. option (this list will be identical to the corresponding sublist of
  599. the value returned if no <EM>option</EM> is specified). If one or more
  600. <EM>option-value</EM> pairs are specified, then the method modifies the
  601. given <CODE>option(s)</CODE> to have the given value(s); in this case the method
  602. returns an empty string.  <EM>Option</EM> may have any of the values
  603. accepted by the <STRONG>indicator create</STRONG> method. The exact set
  604. of options depends on the value of the <STRONG>-itemtype</STRONG> option passed
  605. to the the <STRONG>indicator create</STRONG> method when this display item
  606. was created.
  607. <P></P>
  608. <DT><STRONG><EM>$hlist</EM>-><STRONG>indicator</STRONG>(<STRONG>create, </STRONG><EM>$entryPath, </EM>?, <EM>-itemtype type</EM>? ?<EM>option value ...</EM>?)</STRONG><BR>
  609. <DD>
  610. Creates a new display item as the indicator for the entry specified by
  611. <EM>$entryPath</EM>. If an indicator display item already exists for this
  612. entry, it will be replaced by the new item.  An optional parameter
  613. <EM>-itemtype</EM> can be used to specify what type of display item
  614. should be created. If the <EM>-itemtype</EM> is not given, then by
  615. default the type specified by this HList widget's <STRONG>-itemtype</STRONG>
  616. option is used. Additional parameters, in <EM>option-value</EM> pairs,
  617. can be passed to configure the appearance of the display item. Each
  618. <EM>option-value</EM> pair must be a valid option for this type of
  619. display item.
  620. <P></P>
  621. <DT><STRONG><EM>$hlist</EM>-><STRONG>indicator</STRONG>(<STRONG>delete</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  622. <DD>
  623. Deletes the indicator display item for the entry given by <EM>$entryPath</EM>.
  624. <P></P>
  625. <DT><STRONG><EM>$hlist</EM>-><STRONG>indicator</STRONG>(<STRONG>exists</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  626. <DD>
  627. Return true if an indicator display item exists for the entry given by
  628. <EM>$entryPath</EM>; return false otherwise.
  629. <P></P>
  630. <DT><STRONG><EM>$hlist</EM>-><STRONG>indicator</STRONG>(<STRONG>size</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  631. <DD>
  632. If an indicator display item exists for the entry given by
  633. <EM>$entryPath</EM>, returns its size in a two element list of the form
  634. {<EM>width height</EM>}; returns an error if the indicator display item
  635. does not exist.
  636. <P></P></DL>
  637. <DT><STRONG><A NAME="item_info"><EM>$hlist</EM>-><STRONG>info</STRONG>(<EM>option</EM>, <EM>arg, ...</EM>)</A></STRONG><BR>
  638. <DD>
  639. Query information about the HList widget. <EM>option</EM> can be one
  640. of the following:
  641. <DL>
  642. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>anchor</STRONG>)</STRONG><BR>
  643. <DD>
  644. Returns the entryPath of the current anchor, if any, of the HList
  645. widget. If the anchor is not set, returns the empty string.
  646. <P></P>
  647. <DT><STRONG><A NAME="item_infoBbox"><EM>$hlist</EM>-><STRONG>infoBbox</STRONG>(<EM>$entryPath</EM>)</A></STRONG><BR>
  648. <DD>
  649. Returns a list of four numbers describing the visible bounding box of
  650. the entry given <EM>$entryPath</EM>. The first two elements of the list
  651. give the x and y coordinates of the upper-left corner of the screen
  652. area covered by the entry (specified in pixels relative to the widget)
  653. and the last two elements give the lower-right corner of the area, in
  654. pixels. If no part of the entry given by index is visible on the
  655. screen then the result is an empty string; if the entry is partially
  656. visible, the result gives the only the visible area of the entry.
  657. <P></P>
  658. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>children</STRONG> ?,<EM>$entryPath</EM>?)</STRONG><BR>
  659. <DD>
  660. If <EM>$entryPath</EM> is given, returns a list of the entryPath's of its
  661. children entries. Otherwise returns a list of the toplevel
  662. entryPath's.
  663. <P></P>
  664. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>data</STRONG> ?,<EM>$entryPath</EM>?)</STRONG><BR>
  665. <DD>
  666. Returns the data associated with <EM>$entryPath</EM>.
  667. <P></P>
  668. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>dragsite</STRONG>)</STRONG><BR>
  669. <DD>
  670. Returns the entryPath of the current dragsite, if any, of the HList
  671. widget. If the dragsite is not set, returns the empty string.
  672. <P></P>
  673. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>dropsite</STRONG>)</STRONG><BR>
  674. <DD>
  675. Returns the entryPath of the current dropsite, if any, of the HList
  676. widget. If the dropsite is not set, returns the empty string.
  677. <P></P>
  678. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>exists</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  679. <DD>
  680. Returns a boolean value indicating whether the list entry
  681. <EM>$entryPath</EM> exists.
  682. <P></P>
  683. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>hidden</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  684. <DD>
  685. Returns a boolean value indicating whether the list entry
  686. <STRONG>$entryPath</STRONG> is hidden or not.
  687. <P></P>
  688. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>next</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  689. <DD>
  690. Returns the entryPath of the list entry, if any, immediately below
  691. this list entry. If this entry is already at the bottom of the HList
  692. widget, returns an empty string.
  693. <P></P>
  694. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>parent</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  695. <DD>
  696. Returns the name of the parent of the list entry identified by
  697. <EM>$entryPath</EM>. If <EM>entryPath</EM> is a toplevel list entry,
  698. returns the empty string.
  699. <P></P>
  700. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>prev</STRONG>, <EM>$entryPath</EM>)</STRONG><BR>
  701. <DD>
  702. Returns the entryPath of the list entry, if any, immediately above
  703. this list entry. If this entry is already at the top of the HList
  704. widget, returns an empty string.
  705. <P></P>
  706. <DT><STRONG><EM>$hlist</EM>-><STRONG>info</STRONG>(<STRONG>selection</STRONG>)</STRONG><BR>
  707. <DD>
  708. Returns a list of selected entries in the HList widget. If no entries
  709. are selected, returns an empty string.
  710. <P></P></DL>
  711. <DT><STRONG><A NAME="item_item"><EM>$hlist</EM>-><STRONG>item</STRONG>(<EM>option, </EM>?<EM>args, ...</EM>?)</A></STRONG><BR>
  712. <DD>
  713. Creates and configures the display items at individual columns the
  714. entries. The form of additional of arguments depends on the choice of
  715. <EM>option</EM>:
  716. <DL>
  717. <DT><STRONG><A NAME="item_itemCget"><EM>$hlist</EM>-><STRONG>itemCget</STRONG>(<EM>$entryPath</EM>, <EM>$col</EM>, <EM>option</EM>)</A></STRONG><BR>
  718. <DD>
  719. Returns the current value of the configure <EM>option</EM> of the display
  720. item at the column designated by <EM>$col</EM> of the entry specified by
  721. <EM>$entryPath</EM>.
  722. <P></P>
  723. <DT><STRONG><A NAME="item_itemConfigure"><EM>$hlist</EM>-><STRONG>itemConfigure</STRONG>(<EM>$entryPath</EM>, <EM>$col</EM> ?,<EM>option</EM>?, <EM>?value, option, value, ...</EM>?)</A></STRONG><BR>
  724. <DD>
  725. Query or modify the configuration options of the display item at the
  726. column designated by <EM>$col</EM> of the entry specified by
  727. <EM>$entryPath</EM>. If no <EM>option</EM> is specified, returns a list
  728. describing all of the available options for <EM>$entryPath</EM> (see
  729. <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for information on the format of this
  730. list). If <EM>option</EM> is specified with no <EM>value</EM>, then the
  731. method returns a list describing the one named option (this list will
  732. be identical to the corresponding sublist of the value returned if no
  733. <EM>option</EM> is specified). If one or more <EM>option-value</EM> pairs
  734. are specified, then the method modifies the given <CODE>option(s)</CODE> to have
  735. the given value(s); in this case the method returns an empty string.
  736. <EM>Option</EM> may have any of the values accepted by the <STRONG>item</STRONG>
  737. create method. The exact set of options depends on the
  738. value of the <STRONG>-itemtype</STRONG> option passed to the the <STRONG>item</STRONG>
  739. create method when this display item was created.
  740. <P></P>
  741. <DT><STRONG><A NAME="item_itemCreate"><EM>$hlist</EM>-><STRONG>itemCreate</STRONG>(<EM>$entryPath</EM>, <EM>$col</EM> ?,<EM>-itemtype</EM>=><EM>type</EM>? ?,<EM>option value ...</EM>?)</A></STRONG><BR>
  742. <DD>
  743. Creates a new display item at the column designated by <EM>$col</EM> of
  744. the entry specified by <EM>$entryPath</EM>. An optional parameter
  745. <EM>-itemtype</EM> can be used to specify what type of display items
  746. should be created. If the <EM>-itemtype</EM> is not specified, then by
  747. default the type specified by this HList widget's <STRONG>-itemtype</STRONG>
  748. option is used.  Additional parameters, in <EM>option-value</EM> pairs,
  749. can be passed to configure the appearance of the display item. Each
  750. <EM>option- value</EM> pair must be a valid option for this type of
  751. display item.
  752. <P></P>
  753. <DT><STRONG><A NAME="item_itemDelete"><EM>$hlist</EM>-><STRONG>itemDelete</STRONG>(<EM>$entryPath</EM>, <EM>$col</EM>)</A></STRONG><BR>
  754. <DD>
  755. Deletes the display item at the column designated by <EM>$col</EM> of
  756. the entry specified by <EM>$entryPath</EM>.
  757. <P></P>
  758. <DT><STRONG><A NAME="item_itemExists"><EM>$hlist</EM>-><STRONG>itemExists</STRONG>(<EM>$entryPath</EM>, <EM>$col</EM>)</A></STRONG><BR>
  759. <DD>
  760. Returns true if there is a display item at the column designated by
  761. <EM>$col</EM> of the entry specified by <EM>$entryPath</EM>; returns false
  762. otherwise.
  763. <P></P></DL>
  764. <DT><STRONG><A NAME="item_nearest"><EM>$hlist</EM>-><STRONG>nearest</STRONG>(<EM>y</EM>)</A></STRONG><BR>
  765. <DD>
  766. <EM>$hlist</EM>-><STRONG>nearest</STRONG>(<EM>y</EM>)
  767. Given a y-coordinate within the HList window, this method returns
  768. the entryPath of the (visible) HList element nearest to that
  769. y-coordinate.
  770. <P></P>
  771. <DT><STRONG><A NAME="item_see"><EM>$hlist</EM>-><STRONG>see</STRONG>(<EM>$entryPath</EM>)</A></STRONG><BR>
  772. <DD>
  773. Adjust the view in the HList so that the entry given by <EM>$entryPath</EM> is
  774. visible. If the entry is already visible then the method has no
  775. effect; if the entry is near one edge of the window then the HList
  776. scrolls to bring the element into view at the edge; otherwise the
  777. HList widget scrolls to center the entry.
  778. <P></P>
  779. <DT><STRONG><A NAME="item_selection"><EM>$hlist</EM>-><STRONG>selection</STRONG>(<EM>option</EM>, <EM>arg</EM>, ...)</A></STRONG><BR>
  780. <DD>
  781. <DT><STRONG><A NAME="item_selectionOption"><EM>$hlist</EM>-><STRONG>selection</STRONG><EM>Option</EM>(<EM>arg</EM>, ...)</A></STRONG><BR>
  782. <DD>
  783. This method is used to adjust the selection within a HList widget. It
  784. has several forms, depending on <EM>option</EM>:
  785. <DL>
  786. <DT><STRONG><A NAME="item_selectionClear"><EM>$hlist</EM>-><STRONG>selectionClear</STRONG>(?<EM>from</EM>?, ?<EM>to</EM>?)</A></STRONG><BR>
  787. <DD>
  788. When no extra arguments are given, deselects all of the list <CODE>entrie(s)</CODE>
  789. in this HList widget. When only <EM>from</EM> is given, only the list
  790. entry identified by <EM>from</EM> is deselected. When both <EM>from</EM> and
  791. <EM>to</EM> are given, deselects all of the list <CODE>entrie(s)</CODE> between
  792. between <EM>from</EM> and <EM>to</EM>, inclusive, without affecting the
  793. selection state of elements outside that range.
  794. <P></P>
  795. <DT><STRONG><A NAME="item_selectionGet"><EM>$hlist</EM>-><STRONG>selectionGet</STRONG></A></STRONG><BR>
  796. <DD>
  797. This is an alias for the <STRONG>infoSelection</STRONG> method.
  798. <P></P>
  799. <DT><STRONG><A NAME="item_selectionIncludes"><EM>$hlist</EM>-><STRONG>selectionIncludes</STRONG>(<EM>$entryPath</EM>)</A></STRONG><BR>
  800. <DD>
  801. Returns 1 if the list entry indicated by <EM>$entryPath</EM> is currently
  802. selected; returns 0 otherwise.
  803. <P></P>
  804. <DT><STRONG><A NAME="item_selectionSet"><EM>$hlist</EM>-><STRONG>selectionSet</STRONG>(<EM>from</EM>?, <EM>to</EM>?)</A></STRONG><BR>
  805. <DD>
  806. Selects all of the list <CODE>entrie(s)</CODE> between between <EM>from</EM> and
  807. <EM>to</EM>, inclusive, without affecting the selection state of entries
  808. outside that range. When only <EM>from</EM> is given, only the list entry
  809. identified by <EM>from</EM> is selected.
  810. <P></P></DL>
  811. <DT><STRONG><A NAME="item_show"><EM>$hlist</EM>-><STRONG>show</STRONG>(<EM>option</EM> ?,<EM>$entryPath</EM>?)</A></STRONG><BR>
  812. <DD>
  813. Show the entries that are hidden by the <STRONG>hide</STRONG> method,
  814. <EM>option</EM> can be one of the following:
  815. <DL>
  816. <DT><STRONG><STRONG>entry</STRONG></STRONG><BR>
  817. <DD>
  818. Shows the list entry identified by <EM>$entryPath</EM>.
  819. <P></P></DL>
  820. <P>Currently only the <STRONG>entry</STRONG> option is supported. Other options will
  821. be added in future releases.</P>
  822. <DT><STRONG><A NAME="item_xview"><EM>$hlist</EM>-><STRONG>xview</STRONG>(<EM>args</EM>)</A></STRONG><BR>
  823. <DD>
  824. This method is used to query and change the horizontal position of the
  825. information in the widget's window. It can take any of the following
  826. forms:
  827. <DL>
  828. <DT><STRONG><EM>$hlist</EM>-><STRONG>xview</STRONG></STRONG><BR>
  829. <DD>
  830. Returns a list containing two elements.  Each element is a real
  831. fraction between 0 and 1; together they describe the horizontal span
  832. that is visible in the window.  For example, if the first element is
  833. .2 and the second element is .6, 20% of the HList entry is
  834. off-screen to the left, the middle 40% is visible in the window, and
  835. 40% of the entry is off-screen to the right. These are the same values
  836. passed to scrollbars via the <STRONG>-xscrollcommand</STRONG> option.
  837. <P></P>
  838. <DT><STRONG><EM>$hlist</EM>-><STRONG>xview</STRONG>(<EM>$entryPath</EM>)</STRONG><BR>
  839. <DD>
  840. Adjusts the view in the window so that the list entry identified by
  841. <EM>$entryPath</EM> is aligned to the left edge of the window.
  842. <P></P>
  843. <DT><STRONG><EM>$hlist</EM>-><STRONG>xview</STRONG>(<STRONG>moveto</STRONG> => <EM>fraction</EM>)</STRONG><BR>
  844. <DD>
  845. Adjusts the view in the window so that <EM>fraction</EM> of the total
  846. width of the HList is off-screen to the left. <EM>fraction</EM> must be
  847. a fraction between 0 and 1.
  848. <P></P>
  849. <DT><STRONG><EM>$hlist</EM>-><STRONG>xview</STRONG>(<STRONG>scroll</STRONG> => <EM>number, what</EM>)</STRONG><BR>
  850. <DD>
  851. This method shifts the view in the window left or right according to
  852. <EM>number</EM> and <EM>what</EM>. <EM>Number</EM> must be an integer.
  853. <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG> or an
  854. abbreviation of one of these. If <EM>what</EM> is <STRONG>units</STRONG>, the view
  855. adjusts left or right by <EM>number</EM> character units (the width of
  856. the <STRONG>0</STRONG> character) on the display; if it is <STRONG>pages</STRONG> then the
  857. view adjusts by <EM>number</EM> screenfuls. If <EM>number</EM> is negative
  858. then characters farther to the left become visible; if it is positive
  859. then characters farther to the right become visible.
  860. <P></P></DL>
  861. <DT><STRONG><A NAME="item_yview"><EM>$hlist</EM>-><STRONG>yview</STRONG>(<EM>?args</EM>?)</A></STRONG><BR>
  862. <DD>
  863. This method is used to query and change the vertical position of the
  864. entries in the widget's window. It can take any of the following forms:
  865. <DL>
  866. <DT><STRONG><EM>$hlist</EM>-><STRONG>yview</STRONG></STRONG><BR>
  867. <DD>
  868. Returns a list containing two elements, both of which are real
  869. fractions between 0 and 1.  The first element gives the position of
  870. the list element at the top of the window, relative to the HList as a
  871. whole (0.5 means it is halfway through the HList, for example).  The
  872. second element gives the position of the list entry just after the
  873. last one in the window, relative to the HList as a whole.  These are
  874. the same values passed to scrollbars via the <STRONG>-yscrollcommand</STRONG>
  875. option.
  876. <P></P>
  877. <DT><STRONG><EM>$hlist</EM>-><STRONG>yview</STRONG>(<EM>$entryPath</EM>)</STRONG><BR>
  878. <DD>
  879. Adjusts the view in the window so that the list entry given by
  880. <EM>$entryPath</EM> is displayed at the top of the window.
  881. <P></P>
  882. <DT><STRONG><EM>$hlist</EM>-><STRONG>yview</STRONG>(<STRONG>moveto</STRONG> => <EM>fraction</EM>)</STRONG><BR>
  883. <DD>
  884. Adjusts the view in the window so that the list entry given by
  885. <EM>fraction</EM> appears at the top of the window. <EM>Fraction</EM> is a
  886. fraction between 0 and 1; 0 indicates the first entry in the
  887. HList, 0.33 indicates the entry one-third the way through the
  888. HList, and so on.
  889. <P></P>
  890. <DT><STRONG><EM>$hlist</EM>-><STRONG>yview</STRONG>(<STRONG>scroll</STRONG> => <EM>number, what</EM>)</STRONG><BR>
  891. <DD>
  892. This method adjust the view in the window up or down according to
  893. <EM>number</EM> and <EM>what</EM>.  <EM>Number</EM> must be an integer.
  894. <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG>.  If <EM>what</EM>
  895. is <STRONG>units</STRONG>, the view adjusts up or down by <EM>number</EM> lines; if
  896. it is <STRONG>pages</STRONG> then the view adjusts by <EM>number</EM> screenfuls.
  897. If <EM>number</EM> is negative then earlier entries become visible; if
  898. it is positive then later entries become visible.
  899. <P></P></DL>
  900. </DL>
  901. <P>
  902. <HR>
  903. <H1><A NAME="bindings">BINDINGS</A></H1>
  904. <DL>
  905. <DT><STRONG><A NAME="item_%5B1%5D">[1]</A></STRONG><BR>
  906. <DD>
  907. If the <STRONG>-selectmode</STRONG> is ``browse'', when the user drags the mouse
  908. pointer over the list entries, the entry under the pointer will be
  909. highlighted and the <STRONG>-browsecmd</STRONG> callback will be called with
  910. one parameter, the entryPath of the highlighted entry. Only one entry
  911. can be highlighted at a time. The <STRONG>-command</STRONG> callback will be
  912. called when the user double-clicks on a list entry.
  913. <P></P>
  914. <DT><STRONG><A NAME="item_%5B2%5D">[2]</A></STRONG><BR>
  915. <DD>
  916. If the <STRONG>-selectmode</STRONG> is ``single'', the entries will only be
  917. highlighted by mouse <ButtonRelease-1> events. When a new list entry
  918. is highlighted, the <STRONG>-browsecmd</STRONG> callback will be called with
  919. one parameter indicating the highlighted list entry. The
  920. <STRONG>-command</STRONG> callback will be called when the user double-clicks
  921. on a list entry.
  922. <P></P>
  923. <DT><STRONG><A NAME="item_%5B3%5D">[3]</A></STRONG><BR>
  924. <DD>
  925. If the <STRONG>-selectmode</STRONG> is ``multiple'', when the user drags the mouse
  926. pointer over the list entries, all the entries under the pointer will
  927. be highlighted. However, only a contiguous region of list entries can
  928. be selected. When the highlighted area is changed, the
  929. <STRONG>-browsecmd</STRONG> callback will be called with an undefined
  930. parameter. It is the responsibility of the <STRONG>-browsecmd</STRONG> callback
  931. to find out the exact highlighted selection in the HList. The
  932. <STRONG>-command</STRONG> callback will be called when the user double-clicks
  933. on a list entry.
  934. <P></P>
  935. <DT><STRONG><A NAME="item_%5B4%5D">[4]</A></STRONG><BR>
  936. <DD>
  937. If the <STRONG>-selectmode</STRONG> is ``extended'', when the user drags the mouse
  938. pointer over the list entries, all the entries under the pointer will
  939. be highlighted. The user can also make disjointed selections using
  940. <Control-ButtonPress-1>. When the highlighted area is changed, the
  941. <STRONG>-browsecmd</STRONG> callback will be called with an undefined
  942. parameter. It is the responsibility of the <STRONG>-browsecmd</STRONG> callback
  943. to find out the exact highlighted selection in the HList. The
  944. <STRONG>-command</STRONG> callback will be called when the user double-clicks
  945. on a list entry.
  946. <P></P>
  947. <DT><STRONG><A NAME="item_%5B5%5D">[5]</A></STRONG><BR>
  948. <DD>
  949. <STRONG>Arrow key bindings:</STRONG> <Up> arrow key moves the anchor point to the
  950. item right on top of the current anchor item. <Down> arrow key moves
  951. the anchor point to the item right below the current anchor item.
  952. <Left> arrow key moves the anchor to the parent item of the current
  953. anchor item. <Right> moves the anchor to the first child of the
  954. current anchor item. If the current anchor item does not have any
  955. children, moves the anchor to the item right below the current anchor
  956. item.
  957. <P></P></DL>
  958. <P>
  959. <HR>
  960. <H1><A NAME="example">EXAMPLE</A></H1>
  961. <P>This example demonstrates how to use an HList to store a file
  962. directory structure and respond to the user's browse events:</P>
  963. <PRE>
  964.    use strict;
  965.    use Tk;
  966.    use Tk::Label;
  967.    use Tk::HList;</PRE>
  968. <PRE>
  969.    my $mw = MainWindow->new();
  970.    my $label = $mw->Label(-width=>15);
  971.    my $hlist = $mw->HList(
  972.                        -itemtype   => 'text',
  973.                        -separator  => '/',
  974.                        -selectmode => 'single',
  975.                        -browsecmd  => sub {
  976.                                  my $file = shift;
  977.                                  $label->configure(-text=>$file);
  978.                               }
  979.                        );</PRE>
  980. <PRE>
  981.    foreach ( qw(/ /home /home/ioi /home/foo /usr /usr/lib) ) {
  982.        $hlist->add($_, -text=>$_);
  983.    }</PRE>
  984. <PRE>
  985.    $hlist->pack;
  986.    $label->pack;</PRE>
  987. <PRE>
  988.    MainLoop;</PRE>
  989. <P>
  990. <HR>
  991. <H1><A NAME="bugs">BUGS</A></H1>
  992. <P>The fact that the display item at column 0 is implicitly associated
  993. with the whole entry is probably a design bug. This was done for
  994. backward compatibility purposes. The result is that there is a large
  995. overlap between the <STRONG>item</STRONG> method and the <STRONG>add</STRONG>,
  996. <STRONG>addchild</STRONG>, <STRONG>entrycget</STRONG> and <STRONG>entryconfigure</STRONG>
  997. methods.  Whenever multiple columns exist, the programmer should use
  998. ONLY the <STRONG>item</STRONG> method to create and configure the display items
  999. in each column; the <STRONG>add</STRONG>, <STRONG>addchild</STRONG>, <STRONG>entrycget</STRONG> and
  1000. <STRONG>entryconfigure</STRONG> should be used ONLY to create and configure
  1001. entries.</P>
  1002. <P>
  1003. <HR>
  1004. <H1><A NAME="keywords">KEYWORDS</A></H1>
  1005. <P>Hierarchical Listbox</P>
  1006. <P>
  1007. <HR>
  1008. <H1><A NAME="see also">SEE ALSO</A></H1>
  1009. <P><A HREF="../../../site/lib/Tk/DItem.html">Tk::DItem</A></P>
  1010. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  1011. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  1012. <STRONG><P CLASS=block> Tk::HList - Create and manipulate Tix Hierarchial List widgets</P></STRONG>
  1013. </TD></TR>
  1014. </TABLE>
  1015.  
  1016. </BODY>
  1017.  
  1018. </HTML>
  1019.