home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


A.8 HList - Hierarchical List

This widget is part of the Tix distribution and is supported by Perl/Tk just like any other Tk widget. Table A.14 shows the properties.


Table A.14: HList Methods and Properties

Properties

Description

command

Specifies a reference to a Perl subroutine, which is called when an entry is double clicked upon.

drawbranch

If true, draws lines connecting parent and children and sibling entries.

browsecmd

Called whenever any mouse click or drag event happens over an entry.

columns

Each level of indentation is a column. Column sizes can be individually tailored.

separator

The separator character. Defaults to "."

selectmode

single , browse , multiple , or extended .

indent

Indent amount for each successive level, in pixels.

Methods

add (entrypath, option, values)

Creates a new entry. The options can be at position , before path , after path , and all the entry properties discussed below.

delete (option, entrypath)

Option can be all , entry , offsprings , siblings

column (col, width)

column (col, `char', nchars)

Set the width in pixels or in terms of character widths.

entryconfigure, entrycget

Set/get the entry properties discussed below.

info (option, entryPath)

Option can be children , exists , hidden , next , prev , selection , and so on.

hide, show

Hide or show an entry

Entry Properties

`itemtype'

text , imagetext , and widget .

`text'

The label of that entry.

`image'

A bitmap or a pixmap. Used if itemtype is imagetext .

Note that this is a scrollable widget, so it also supports the generic xscrollcommand and yscrollcommand properties listed in Table A.12 . This also means that a simple way to create a scrolled HList box is to call $ parent ->ScrlHList( options ) .