GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TK::HLIST (3)

.ds Aq ’

NAME

Tk::HList - Create and manipulate Tix Hierarchial List widgets

CONTENTS

SYNOPSIS

$hlist = $parent-><B>HListB>(?options?);

STANDARD OPTIONS

<B>-backgroundB> <B>-borderwidthB>        <B>-cursorB>     <B>-exportselectionB> <B>-foregroundB> <B>-fontB>       <B>-heightB>     <B>-highlightcolorB> <B>-highlightthicknessB> <B>-reliefB>     <B>-selectbackgroundB> <B>-selectforegroundB>   <B>-xscrollcommandB>     <B>-yscrollcommandB> <B>-widthB>

See Tk::options for details of the standard options.

WIDGET-SPECIFIC OPTIONS

Name:  <B>browsecmdB>
Class: <B>BrowseCmdB>
Switch:        <B>-browsecmdB> Specifies a perl/Tk callback to be executed when the user browses through the entries in the HList widget.
Name:  <B>columnsB>
Class: <B>ColumnsB>
Switch:        <B>-columnsB> Specifies the number of columns in this HList widget. This option can only be set during the creation of the HList widget and cannot be changed subsequently.
Name:  <B>commandB>
Class: <B>CommandB>
Switch:        <B>-commandB> Specifies the perl/Tk callback to be executed when the user invokes a list entry in the HList widget. Normally the user invokes a list entry by double-clicking it or pressing the Return key.
Name:  <B>drawBranchB>
Class: <B>DrawBranchB>
Switch:        <B>-drawbranchB> A Boolean value to specify whether branch line should be drawn to connect list entries to their parents.
Name:  <B>foregroundB>
Class: <B>ForegroundB>
Switch:        <B>-foregroundB>
Alias: <B>-fgB> <B>[OBSOLETE]B> Specifies the default foreground color for the list entries.
Name:  <B>gapB>
Class: <B>GapB>
Switch:        <B>-gapB> <B>[OBSOLETE]B> The default distance between the bitmap/image and the text in list entries.
Name:  <B>headerB>
Class: <B>HeaderB>
Switch:        <B>-headerB> A Boolean value specifying whether headers should be displayed for this HList widget (see the <B>headerB> method below).
Name:  <B>heightB>
Class: <B>HeightB>
Switch:        <B>-heightB> Specifies the desired height for the window in number of characters.
Name:  <B>indentB>
Class: <B>IndentB>
Switch:        <B>-indentB> Specifies the amount of horizontal indentation between a list entry and its children. Must be a valid screen distance value.
Name:  <B>indicatorB>
Class: <B>IndicatorB>
Switch:        <B>-indicatorB> Specifies whether the indicators should be displayed inside the HList widget. See the <B>indicatorB> method below.
Name:  <B>indicatorCmdB>
Class: <B>IndicatorCmdB>
Switch:        <B>-indicatorcmdB> Specifies a perl/Tk callback to be executed when the user manipulates the indicator of an HList entry. The <B>-indicatorcmdB> is triggered when the user press or releases the mouse button over the indicator in an HList entry. By default the perl/Tk <B>callbackB> specified by <B>-indicatorcmdB> is executed with two additional arguments, the entryPath of the entry whose indicator has been triggered and additional information about the event. The additional information is one of the following strings: <B><Arm>B>, <B><Disarm>B>, and <B><Activate>B>.
Name:  <B>itemTypeB>
Class: <B>ItemTypeB>
Switch:        <B>-itemtypeB> Specifies the default type of display item for this HList widget. When you call the <B>itemCreateB>, <B>addB> and <B>addchildB> methods, display items of this type will be created if the <B>-itemtypeB> option is not specified .
Name:  <B>padXB>
Class: <B>PadB>
Switch:        <B>-padxB> <B>[OBSOLETE]B> The default horizontal padding for list entries.
Name:  <B>padYB>
Class: <B>PadB>
Switch:        <B>-padxB> <B>[OBSOLETE]B> The default vertical padding for list entries.
Name:  <B>selectBackgroundB>
Class: <B>SelectBackgroundB>
Switch:        <B>-selectbackgroundB> Specifies the background color for the selected list entries.
Name:  <B>selectBorderWidthB>
Class: <B>BorderWidthB>
Switch:        <B>-selectborderwidthB> Specifies a non-negative value indicating the width of the 3-D border to draw around selected items. The value may have any of the forms acceptable to <B>Tk_GetPixelsB>.
Name:  <B>selectForegroundB>
Class: <B>SelectForegroundB>
Switch:        <B>-selectforegroundB> Specifies the foreground color for the selected list entries.
Name:  <B>selectModeB>
Class: <B>SelectModeB>
Switch:        <B>-selectmodeB> Specifies one of several styles for manipulating the selection. The value of the option may be arbitrary, but the default bindings expect it to be either <B>singleB>, <B>browseB>, <B>multipleB>, or <B>extendedB>; the default value is <B>singleB>.
Name:  <B>sizeCmdB>
Class: <B>SizeCmdB>
Switch:        <B>-sizecmdB> Specifies a perl/Tk callback to be called whenever the HList widget changes its size. This method can be useful to implement ‘‘user scroll bars when needed’’ features.
Name:  <B>separatorB>
Class: <B>SeparatorB>
Switch:        <B>-separatorB> Specifies the character to used as the separator character when intepreting the path-names of list entries. By default the character . is used.
Name:  <B>widthB>
Class: <B>WidthB>
Switch:        <B>-widthB> Specifies the desired width for the window in characters.

DESCRIPTION

The <B>HListB> method creates a new window (given by the $widget argument) and makes it into a HList widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the HList widget such as its cursor and relief.

The HList widget can be used to display any data that have a hierarchical structure, for example, file system directory trees. The list entries are indented and connected by branch lines according to their places in the hierachy.

Each list entry is identified by an <B>entryPathB>. The entryPath is a sequence of <B>entry namesB> separated by the separator charactor (specified by the <B>-separatorB> option). An <B>entry nameB> can be any string that does not contain the separator charactor, or it can be the a string that contains only one separator charactor.

For example, when . is used as the separator charactor, one.two.three is the entryPath for a list entry whose parent is one.two, whose parent is one, which is a toplevel entry (has no parents).

Another examples: .two.three is the entryPath for a list entry whose parent is .two, whose parent is ., which is a toplevel entry.

DISPLAY ITEMS

Each list entry in an HList widget is associated with a <B>displayB> item. The display item determines what visual information should be displayed for this list entry. Please see Tk::DItem for a list of all display items. When a list entry is created by the <B>itemCreateB>, <B>addB> or <B>addchildB> widget methods, the type of its display item is determined by the <B>-itemtypeB> option passed to these methods. If the <B>-itemtypeB> is omitted, then by default the type specified by this HList widget’s <B>-itemtypeB> option is used.

WIDGET METHODS

The <B>HListB> method creates a widget object. This object supports the <B>configureB> and <B>cgetB> methods described in Tk::options which can be used to enquire and modify the options described above. The widget also inherits all the methods provided by the generic Tk::Widget class.

The following additional methods are available HList widgets:
$hlist-><B>addB>($entryPath ?,option=>value, ...?) Creates a new list entry with the pathname $entryPath. A list entry must be created after its parent is created (unless this entry is a top-level entry, which has no parent). See also BUGS below. This method returns the entryPath of the newly created list entry. The following configuration options can be given to configure the list entry:
<B>-atB> => position Insert the new list at the position given by position. position must be a valid integer. The position <B>0B> indicates the first position, <B>1B> indicates the second position, and so on.
<B>-afterB> => afterWhich Insert the new list entry after the entry identified by afterWhich. afterWhich must be a valid list entry and it mush have the same parent as the new list entry
<B>-beforeB> => beforeWhich Insert the new list entry before the entry identified by beforeWhich. beforeWhich must be a valid list entry and it mush have the same parent as the new list entry
<B>-dataB> => string Specifies a string to associate with this list entry. This string can be queried by the <B>infoB> method. The application programmer can use the <B>-dataB> option to associate the list entry with the data it represents.
<B>-itemtypeB> => type Specifies the type of display item to be display for the new list entry. <B>typeB> must be a valid display item type. Currently the available display item types are <B>imagetextB>, <B>textB>, and $widget. If this option is not specified, then by default the type specified by this HList widget’s <B>-itemtypeB> option is used.
<B>-stateB> => state Specifies whether this entry can be selected or invoked by the user. Must be either <B>normalB> or <B>disabledB>.

The <B>addB> method accepts additional configuration options to configure the display item associated with this list entry. The set of additional configuration options depends on the type of the display item given by the <B>-itemtypeB> option. Please see Tk::DItem for a list of the configuration options for each of the display item types.

$hlist-><B>addchildB>($parentPath, ?option, value, ..., ?) Adds a new child entry to the children list of the list entry identified by $parentPath. Or, if $parentPath is set to be the empty string, then creates a new toplevel entry. The name of the new list entry will be a unique name automatically generated by the HList widget. Usually if $parentPath is <B>fooB>, then the entryPath of the new entry will be <B>foo.0B>, <B>foo.1B>, ... etc. This method returns the entryPath of the newly created list entry. option can be any option for the <B>addB> method. See also BUGS below.
$hlist-><B>anchorSetB>($entryPath) Sets the anchor to the list entry identified by $entryPath. The anchor is the end of the selection that is fixed while the user is dragging out a selection with the mouse.
$hlist-><B>anchorClearB> Removes the anchor, if any, from this HList widget. This only removes the surrounding highlights of the anchor entry and does not affect its selection status.
$hlist-><B>columnWidthB>($col?, -char?, ?width?) Querys or sets the width of a the column $col in the HList widget. The value of $col is zero-based: 0 stands for the first column, 1 stands for the second, and so on. If no further parameters are given, returns the current width of this column (in number of pixels). Additional parameters can be given to set the width of this column:
$hlist-><B>columnWidthB>($col, <B>’’B>) An empty string indicates that the width of the column should be just wide enough to display the widest element in this column. In this case, the width of this column may change as a result of the elements in this column changing their sizes.
$hlist-><B>columnWidthB>($col, width) width must be in a form accepted by <B>Tk_GetPixelsB>.
$hlist-><B>columnWidthB>($col, <B>-char, B>nChars) The width is set to be the average width occupied by nChars number of characters of the font specified by the <B>-fontB> option of this HList widget.
$hlist-><B>deleteB>(option, $entryPath) Delete one or more list entries. option may be one of the following:
<B>allB> Delete all entries in the HList. In this case the $entryPath does not need to be specified.
<B>entryB> Delete the entry specified by $entryPath and all its offsprings, if any.
<B>offspringsB> Delete all the offsprings, if any, of the entry specified by $entryPath. However, $entryPath itself is not deleted.
<B>siblingsB> Delete all the list entries that share the same parent with the entry specified by $entryPath. However, $entryPath itself is not deleted.
$hlist-><B>dragsiteSetB>($entryPath) Sets the dragsite to the list entry identified by $entryPath. The dragsite is used to indicate the source of a drag-and-drop action. Currently drag-and-drop functionality has not been implemented in Tix yet.
$hlist-><B>dragsiteClearB> Remove the dragsite, if any, from the this HList widget. This only removes the surrounding highlights of the dragsite entry and does not affect its selection status.
$hlist-><B>dropsiteSetB>($entryPath) Sets the dropsite to the list entry identified by $entryPath. The dropsite is used to indicate the target of a drag-and-drop action. Currently drag-and-drop functionality has not been implemented in Tix yet.
$hlist-><B>dropsiteClearB> Remove the dropsite, if any, from the this HList widget. This only removes the surrounding highlights of the dropsite entry and does not affect its selection status.
$hlist-><B>entrycgetB>($entryPath, option) Returns the current value of the configuration option given by option for the entry indentfied by $entryPath. Option may have any of the values accepted by the <B>addB> method.
$hlist-><B>entryconfigureB>($entryPath ?,option?, ?value=>option, ...?) Query or modify the configuration options of the list entry indentfied by $entryPath. If no option is specified, returns a list describing all of the available options for $entryPath (see Tk::options for information on the format of this list.) If option is specified with no value, then the method returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the method modifies the given option(s) to have the given value(s); in this case the method returns an empty string. Option may have any of the values accepted by the <B>addB> or <B>addchildB> method. The exact set of options depends on the value of the <B>-itemtypeB> option passed to the the <B>addB> or <B>addchildB> method when this list entry is created.
$hlist-><B>headerB>(option, $col ?,args, ...?) Manipulates the header items of this HList widget. If the <B>-headerB> option of this HList widget is set to true, then a header item is displayed at the top of each column. The $col argument for this method must be a valid integer. 0 indicates the first column, 1 the second column, ... and so on. This method supports the following options:
$hlist-><B>headerB>(<B>cgetB>, $col, option) If the $col-th column has a header display item, returns the value of the specified option of the header item. If the header doesn’t exist, returns an error.
$hlist-><B>headerB>(<B>configure, B>$col, ?option?, ?value, option, value, ...?) Query or modify the configuration options of the header display item of the $col-th column. The header item must exist, or an error will result. If no option is specified, returns a list describing all of the available options for the header display item (see Tk::options for information on the format of this list.) If option is specified with no value, then the method returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the method modifies the given option(s) to have the given value(s); in this case the method returns an empty string. Option may have any of the values accepted by the <B>header createB> method. The exact set of options depends on the value of the <B>-itemtypeB> option passed to the the <B>headerB> create method when this display item was created.
$hlist-><B>headerB>(<B>create, B>$col, ?-itemtype type? ?option value ...? Creates a new display item as the header for the $col-th column. See also BUGS below. If an header display item already exists for this column, it will be replaced by the new item. An optional parameter -itemtype can be used to specify what type of display item should be created. If the -itemtype is not given, then by default the type specified by this HList widget’s <B>-itemtypeB> option is used. Additional parameters, in option-value pairs, can be passed to configure the appearance of the display item. Each option-value pair must be a valid option for this type of display item or one of the following:
<B>-borderwidthB> => color Specifies the border width of this header item.
<B>-headerbackgroundB> => color Specifies the background color of this header item.
<B>-reliefB> => type Specifies the relief type of the border of this header item.
$hlist-><B>headerB>(<B>delete, B>$col) Deletes the header display item for the $col-th column.
$hlist-><B>headerB>(<B>exists, B>$col) Return true if an header display item exists for the $col-th column; return false otherwise.
$hlist-><B>headerB>(<B>sizeB>, $col) If an header display item exists for the $col-th column , returns its size in pixels in a two element list (width, height); returns an error if the header display item does not exist.
$hlist-><B>hideB>(option ?,$entryPath?) Makes some of entries invisible without deleting them. Option can be one of the following:
<B>entryB> Hides the list entry identified by $entryPath.

Currently only the <B>entryB> option is supported. Other options will be added in the next release.

$hlist-><B>indicatorB>(option, $entryPath, ?args, ...?) Manipulates the indicator on the list entries. An indicator is usually a small display item (such as an image) that is displayed to the left to an entry to indicate the status of the entry. For example, it may be used to indicate whether a directory is opened or closed. Option can be one of the following:
$hlist-><B>indicatorB>(<B>cgetB>, $entryPath, option) If the list entry given by $entryPath has an indicator, returns the value of the specified option of the indicator. If the indicator doesn’t exist, returns an error.
$hlist-><B>indicatorB>(<B>configureB>, $entryPath, ?option?, ?value, option, value, ...?) Query or modify the configuration options of the indicator display item of the entry specified by $entryPath. The indicator item must exist, or an error will result. If no option is specified, returns a list describing all of the available options for the indicator display item (see Tk::options for information on the format of this list). If option is specified with no value, then the method returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the method modifies the given option(s) to have the given value(s); in this case the method returns an empty string. Option may have any of the values accepted by the <B>indicator createB> method. The exact set of options depends on the value of the <B>-itemtypeB> option passed to the the <B>indicator createB> method when this display item was created.
$hlist-><B>indicatorB>(<B>create, B>$entryPath, ?, -itemtype type? ?option value ...?) Creates a new display item as the indicator for the entry specified by $entryPath. If an indicator display item already exists for this entry, it will be replaced by the new item. An optional parameter -itemtype can be used to specify what type of display item should be created. If the -itemtype is not given, then by default the type specified by this HList widget’s <B>-itemtypeB> option is used. Additional parameters, in option-value pairs, can be passed to configure the appearance of the display item. Each option-value pair must be a valid option for this type of display item.
$hlist-><B>indicatorB>(<B>deleteB>, $entryPath) Deletes the indicator display item for the entry given by $entryPath.
$hlist-><B>indicatorB>(<B>existsB>, $entryPath) Return true if an indicator display item exists for the entry given by $entryPath; return false otherwise.
$hlist-><B>indicatorB>(<B>sizeB>, $entryPath) If an indicator display item exists for the entry given by $entryPath, returns its size in a two element list of the form {width height}; returns an error if the indicator display item does not exist.
$hlist-><B>infoB>(option, arg, ...) Query information about the HList widget. option can be one of the following:
$hlist-><B>infoB>(<B>anchorB>) Returns the entryPath of the current anchor, if any, of the HList widget. If the anchor is not set, returns the empty string.
$hlist-><B>infoBboxB>($entryPath) Returns a list of four numbers describing the visible bounding box of the entry given $entryPath. The first two elements of the list give the x and y coordinates of the upper-left corner of the screen area covered by the entry (specified in pixels relative to the widget) and the last two elements give the lower-right corner of the area, in pixels. If no part of the entry given by index is visible on the screen then the result is an empty string; if the entry is partially visible, the result gives the only the visible area of the entry.
$hlist-><B>infoB>(<B>childrenB> ?,$entryPath?) If $entryPath is given, returns a list of the entryPath’s of its children entries. Otherwise returns a list of the toplevel entryPath’s.
$hlist-><B>infoB>(<B>dataB> ?,$entryPath?) Returns the data associated with $entryPath.
$hlist-><B>infoB>(<B>dragsiteB>) Returns the entryPath of the current dragsite, if any, of the HList widget. If the dragsite is not set, returns the empty string.
$hlist-><B>infoB>(<B>dropsiteB>) Returns the entryPath of the current dropsite, if any, of the HList widget. If the dropsite is not set, returns the empty string.
$hlist-><B>infoB>(<B>existsB>, $entryPath) Returns a boolean value indicating whether the list entry $entryPath exists.
$hlist-><B>infoB>(<B>hiddenB>, $entryPath) Returns a boolean value indicating whether the list entry <B>B>$entryPath<B>B> is hidden or not.
$hlist-><B>infoB>(<B>nextB>, $entryPath) Returns the entryPath of the list entry, if any, immediately below this list entry. If this entry is already at the bottom of the HList widget, returns an empty string.
$hlist-><B>infoB>(<B>parentB>, $entryPath) Returns the name of the parent of the list entry identified by $entryPath. If entryPath is a toplevel list entry, returns the empty string.
$hlist-><B>infoB>(<B>prevB>, $entryPath) Returns the entryPath of the list entry, if any, immediately above this list entry. If this entry is already at the top of the HList widget, returns an empty string.
$hlist-><B>infoB>(<B>selectionB>) Returns a list of selected entries in the HList widget. In scalar context, returns an anonymous list of the selected entries. If no entries are selected, undef is returned in scalar context, and an empty list otherwise.
$hlist-><B>itemB>(option, ?args, ...?) Creates and configures the display items at individual columns the entries. The form of additional of arguments depends on the choice of option:
$hlist-><B>itemCgetB>($entryPath, $col, option) Returns the current value of the configure option of the display item at the column designated by $col of the entry specified by $entryPath.
$hlist-><B>itemConfigureB>($entryPath, $col ?,option?, ?value, option, value, ...?) Query or modify the configuration options of the display item at the column designated by $col of the entry specified by $entryPath. If no option is specified, returns a list describing all of the available options for $entryPath (see Tk::options for information on the format of this list). If option is specified with no value, then the method returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the method modifies the given option(s) to have the given value(s); in this case the method returns an empty string. Option may have any of the values accepted by the <B>itemB> create method. The exact set of options depends on the value of the <B>-itemtypeB> option passed to the the <B>itemB> create method when this display item was created.
$hlist-><B>itemCreateB>($entryPath, $col ?,-itemtype=>type? ?,option value ...?) Creates a new display item at the column designated by $col of the entry specified by $entryPath. An optional parameter -itemtype can be used to specify what type of display items should be created. If the -itemtype is not specified, then by default the type specified by this HList widget’s <B>-itemtypeB> option is used. Additional parameters, in option-value pairs, can be passed to configure the appearance of the display item. Each option- value pair must be a valid option for this type of display item.
$hlist-><B>itemDeleteB>($entryPath, $col) Deletes the display item at the column designated by $col of the entry specified by $entryPath.
$hlist-><B>itemExistsB>($entryPath, $col) Returns true if there is a display item at the column designated by $col of the entry specified by $entryPath; returns false otherwise.
$hlist-><B>nearestB>(y) $hlist-><B>nearestB>(y) Given a y-coordinate within the HList window, this method returns the entryPath of the (visible) HList element nearest to that y-coordinate.
$hlist-><B>seeB>($entryPath) Adjust the view in the HList so that the entry given by $entryPath is visible. If the entry is already visible then the method has no effect; if the entry is near one edge of the window then the HList scrolls to bring the element into view at the edge; otherwise the HList widget scrolls to center the entry.
$hlist-><B>selectionB>(option, arg, ...)
$hlist-><B>selectionB>Option(arg, ...) This method is used to adjust the selection within a HList widget. It has several forms, depending on option:
$hlist-><B>selectionClearB>(?from?, ?to?) When no extra arguments are given, deselects all of the list entrie(s) in this HList widget. When only from is given, only the list entry identified by from is deselected. When both from and to are given, deselects all of the list entrie(s) between between from and to, inclusive, without affecting the selection state of elements outside that range.
$hlist-><B>selectionGetB> This is an alias for the <B>infoSelectionB> method.
$hlist-><B>selectionIncludesB>($entryPath) Returns 1 if the list entry indicated by $entryPath is currently selected; returns 0 otherwise.
$hlist-><B>selectionSetB>(from?, to?) Selects all of the list entrie(s) between between from and to, inclusive, without affecting the selection state of entries outside that range. When only from is given, only the list entry identified by from is selected.
$hlist-><B>showB>(option ?,$entryPath?) Show the entries that are hidden by the <B>hideB> method, option can be one of the following:
<B>entryB> Shows the list entry identified by $entryPath.

Currently only the <B>entryB> option is supported. Other options will be added in future releases.

$hlist-><B>xviewB>(args) This method is used to query and change the horizontal position of the information in the widget’s window. It can take any of the following forms:
$hlist-><B>xviewB> Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the horizontal span that is visible in the window. For example, if the first element is .2 and the second element is .6, 20% of the HList entry is off-screen to the left, the middle 40% is visible in the window, and 40% of the entry is off-screen to the right. These are the same values passed to scrollbars via the <B>-xscrollcommandB> option.
$hlist-><B>xviewB>($entryPath) Adjusts the view in the window so that the list entry identified by $entryPath is aligned to the left edge of the window.
$hlist-><B>xviewB>(<B>movetoB> => fraction) Adjusts the view in the window so that fraction of the total width of the HList is off-screen to the left. fraction must be a fraction between 0 and 1.
$hlist-><B>xviewB>(<B>scrollB> => number, what) This method shifts the view in the window left or right according to number and what. Number must be an integer. What must be either <B>unitsB> or <B>pagesB> or an abbreviation of one of these. If what is <B>unitsB>, the view adjusts left or right by number character units (the width of the <B>0B> character) on the display; if it is <B>pagesB> then the view adjusts by number screenfuls. If number is negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible.
$hlist-><B>yviewB>(?args?) This method is used to query and change the vertical position of the entries in the widget’s window. It can take any of the following forms:
$hlist-><B>yviewB> Returns a list containing two elements, both of which are real fractions between 0 and 1. The first element gives the position of the list element at the top of the window, relative to the HList as a whole (0.5 means it is halfway through the HList, for example). The second element gives the position of the list entry just after the last one in the window, relative to the HList as a whole. These are the same values passed to scrollbars via the <B>-yscrollcommandB> option.
$hlist-><B>yviewB>($entryPath) Adjusts the view in the window so that the list entry given by $entryPath is displayed at the top of the window.
$hlist-><B>yviewB>(<B>movetoB> => fraction) Adjusts the view in the window so that the list entry given by fraction appears at the top of the window. Fraction is a fraction between 0 and 1; 0 indicates the first entry in the HList, 0.33 indicates the entry one-third the way through the HList, and so on.
$hlist-><B>yviewB>(<B>scrollB> => number, what) This method adjust the view in the window up or down according to number and what. Number must be an integer. What must be either <B>unitsB> or <B>pagesB>. If what is <B>unitsB>, the view adjusts up or down by number lines; if it is <B>pagesB> then the view adjusts by number screenfuls. If number is negative then earlier entries become visible; if it is positive then later entries become visible.

BINDINGS

[1] If the <B>-selectmodeB> is browse, when the user drags the mouse pointer over the list entries, the entry under the pointer will be highlighted and the <B>-browsecmdB> callback will be called with one parameter, the entryPath of the highlighted entry. Only one entry can be highlighted at a time. The <B>-commandB> callback will be called when the user double-clicks on a list entry.
[2] If the <B>-selectmodeB> is single, the entries will only be highlighted by mouse <ButtonRelease-1> events. When a new list entry is highlighted, the <B>-browsecmdB> callback will be called with one parameter indicating the highlighted list entry. The <B>-commandB> callback will be called when the user double-clicks on a list entry.
[3] If the <B>-selectmodeB> is multiple, when the user drags the mouse pointer over the list entries, all the entries under the pointer will be highlighted. However, only a contiguous region of list entries can be selected. When the highlighted area is changed, the <B>-browsecmdB> callback will be called with an undefined parameter. It is the responsibility of the <B>-browsecmdB> callback to find out the exact highlighted selection in the HList. The <B>-commandB> callback will be called when the user double-clicks on a list entry.
[4] If the <B>-selectmodeB> is extended, when the user drags the mouse pointer over the list entries, all the entries under the pointer will be highlighted. The user can also make disjointed selections using <Control-ButtonPress-1>. When the highlighted area is changed, the <B>-browsecmdB> callback will be called with an undefined parameter. It is the responsibility of the <B>-browsecmdB> callback to find out the exact highlighted selection in the HList. The <B>-commandB> callback will be called when the user double-clicks on a list entry.
[5] <B>Arrow key bindings:B> <Up> arrow key moves the anchor point to the item right on top of the current anchor item. <Down> arrow key moves the anchor point to the item right below the current anchor item. <Left> arrow key moves the anchor to the parent item of the current anchor item. <Right> moves the anchor to the first child of the current anchor item. If the current anchor item does not have any children, moves the anchor to the item right below the current anchor item.

EXAMPLE

This example demonstrates how to use an HList to store a file directory structure and respond to the user’s browse events:



   use strict;
   use Tk;
   use Tk::Label;
   use Tk::HList;

   my $mw = MainWindow->new();
   my $label = $mw->Label(-width=>15);
   my $hlist = $mw->HList(
                       -itemtype   => text,
                       -separator  => /,
                       -selectmode => single,
                       -browsecmd  => sub {
                                 my $file = shift;
                                 $label->configure(-text=>$file);
                              }
                       );

   foreach ( qw(/ /home /home/ioi /home/foo /usr /usr/lib) ) {
       $hlist->add($_, -text=>$_);
   }

   $hlist->pack;
   $label->pack;

   MainLoop;



BUGS

The fact that the display item at column 0 is implicitly associated with the whole entry is probably a design bug. This was done for backward compatibility purposes. The result is that there is a large overlap between the <B>itemB> method and the <B>addB>, <B>addchildB>, <B>entrycgetB> and <B>entryconfigureB> methods. Whenever multiple columns exist, the programmer should use ONLY the <B>itemB> method to create and configure the display items in each column; the <B>addB>, <B>addchildB>, <B>entrycgetB> and <B>entryconfigureB> should be used ONLY to create and configure entries.

KEYWORDS

Hierarchical Listbox

SEE ALSO

Tk::DItem
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HLIST (3) 2013-11-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.