tixTree - Create and manipulate tixTree widgets


SYNOPSIS

tixTree pathName ?options?

SUPER-CLASS

The TixTree
class is derived from the TixScrolledHList
class and inherits all the commands, options and subwidgets of its super-class.

STANDARD OPTIONS

TixTree supports all the standard options of a frame widget. See the options(n) manual entry for details on the standard options.

WIDGET-SPECIFIC OPTIONS


Name:		browseCmd
Class:		BrowseCmd
Switch:		-browsecmd


Name:		closeCmd
Class:		CloseCmd
Switch:		-closecmd


Name:		command
Class:		Command
Switch:		-command


Name:		ignoreInvoke
Class:		IgnoreInvoke
Switch:		-ignoreinvoke


Name:		openCmd
Class:		OpenCmd
Switch:		-opencmd

SUBWIDGETS


Name:		hlist
Class:		TixHList


Name:		hsb
Class:		Scrollbar


Name:		vsb
Class:		Scrollbar

DESCRIPTION

The tixTree command creates a new window (given by the pathName argument) and makes it into a Tree widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the Tree widget such as its cursor and relief. The Tree widget can be used to display hierachical data in a tree form. The user can adjust the view of the tree by opening or closing parts of the tree. To display a static tree structure, you can add the entries into the hlist subwidget and hide any entries as desired. Then you can call the autosetmode method. This will set up the Tree widget so that it handles all the open and close events automatically. (Please see the demonstration program demos/samples/Tree.tcl). The above method is not applicable if you want to maintain a dynamic tree structure, i.e, you do not know all the entries in the tree and you need to add or delete entries subsequently. To do this, you should first create the entries in the hlist subwidget. Then, use the setmode method to indicate the entries that can be opened or closed, and use the -opencmd and -closecmd options to handle the opening and closing events. (Please see the demonstration program demos/samples/DynTree.tcl demo).

WIDGET COMMANDS

The tixTree command creates a new Tcl command whose name is the to invoke various operations on the widget. It has the following general form:

pathName option ?arg arg ...?

PathName is the name of the command, which is the same as the determine the exact behavior of the command. The following commands are possible for Tree widgets:
pathName autosetmode
This command calls the setmode method for all the entries in this Tree widget: if an entry has no child entries, its mode is set to none. Otherwise, if the entry has any hidden child entries, its mode is set to open; otherwise its mode is set to close.
pathName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the tixTree command.
pathName close entryPath
Close the entry given by entryPath if its mode is close.
pathName configure ?option? ?value option value ...?
Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command 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 command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the tixTree command.
pathName getmode entryPath
Returns the current mode of the entry given by entryPath.
pathName open entryPath
Open the entry givaen by entryPath if its mode is open.
pathName setmode entryPath mode
This command is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) indicator is drawn next the the entry. If mode is set to close, a (-) indicator is drawn next the the entry. If mode is set to none, no indicators will be drawn for this entry. The default mode is none. The open mode indicates the entry has hidden children and this entry can be opened by the user. The close mode indicates that all the children of the entry are now visible and the entry can be closed by the user.
pathName subwidget name ?args?
When no options are given, this command returns the pathname of the subwidget of the specified name. When options are given, the widget command of the specified subwidget will be called with these options.

BINDINGS

The basic mouse and keyboard bindings of the Tree widget are the same as the bindings of the HList widget. In addition, the entries can be opened or closed under the following conditions:

KEYWORDS

Tix(n),tixHList(n)
Last modified Sun Jan 19 22:34:40 EST 1997 --- Serial 853731306