'\" '\" Generated from file 'doc/treectrl.man' by tcllib/doctools with format 'nroff' '\" '\" Copyright (c) 2002-2003 Christian Krone. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" $Id: treectrl.n,v 1.37 2005/06/02 06:01:12 treectrl Exp $ .so man.macros .TH "treectrl" n 2.0 "Tk Commands" .BS .SH "NAME" treectrl \- Create and manipulate hierarchical multicolumn widgets .SH "SYNOPSIS" package require \fBtreectrl 2.0\fR .sp \fBtreectrl\fR \fIpathName\fR ?\fIoptions\fR?\fR .sp \fIpathName\fR \fBactivate\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBcanvasx\fR \fIscreenx\fR\fR .sp \fIpathName\fR \fBcanvasy\fR \fIscreeny\fR\fR .sp \fIpathName\fR \fBcget\fR \fIoption\fR\fR .sp \fIpathName\fR \fBcollapse\fR ?\fB-recurse\fR? ?\fIitemDesc ...\fR?\fR .sp \fIpathName\fR \fBcolumn\fR \fIoption\fR \fIcolumn\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBcolumn bbox\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBcolumn cget\fR \fIcolumn\fR \fIoption\fR\fR .sp \fIpathName\fR \fBcolumn configure\fR \fIcolumn\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBcolumn compare\fR \fIcolumn1\fR \fIop\fR \fIcolumn2\fR\fR .sp \fIpathName\fR \fBcolumn count\fR\fR .sp \fIpathName\fR \fBcolumn create\fR ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBcolumn delete\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBcolumn dragcget\fR \fIoption\fR\fR .sp \fIpathName\fR \fBcolumn dragconfigure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBcolumn index\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBcolumn id\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBcolumn list\fR ?\fI-visible\fR?\fR .sp \fIpathName\fR \fBcolumn move\fR \fIcolumn\fR \fIbefore\fR\fR .sp \fIpathName\fR \fBcolumn neededwidth\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBcolumn order\fR \fIcolumn\fR ?\fI-visible\fR?\fR .sp \fIpathName\fR \fBcolumn width\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBcompare\fR \fIitemDesc1\fR \fIop\fR \fIitemDesc2\fR\fR .sp \fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?\fR .sp \fIpathName\fR \fBcontentbox\fR\fR .sp \fIpathName\fR \fBdebug\fR \fIoption\fR ?\fIarg arg ...\fR?\fR .sp \fIpathName\fR \fBdebug cget\fR \fIelement\fR \fIoption\fR\fR .sp \fIpathName\fR \fBdebug configure\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBdebug dinfo\fR\fR .sp \fIpathName\fR \fBdebug scroll\fR\fR .sp \fIpathName\fR \fBdepth\fR ?\fIitemDesc\fR?\fR .sp \fIpathName\fR \fBdragimage\fR \fIoption\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBdragimage add\fR \fIitemDesc\fR ?\fIcolumn\fR? ?\fIelement\fR?\fR .sp \fIpathName\fR \fBdragimage cget\fR \fIoption\fR\fR .sp \fIpathName\fR \fBdragimage clear\fR\fR .sp \fIpathName\fR \fBdragimage configure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBdragimage offset\fR ?\fIx y\fR?\fR .sp \fIpathName\fR \fBelement\fR \fIoption\fR ?\fIelement\fR? ?\fIarg arg ...\fR?\fR .sp \fIpathName\fR \fBelement cget\fR \fIelement\fR \fIoption\fR\fR .sp \fIpathName\fR \fBelement configure\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBelement create\fR \fIelement\fR \fItype\fR ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBelement delete\fR ?\fIelement ...\fR?\fR .sp \fIpathName\fR \fBelement names\fR\fR .sp \fIpathName\fR \fBelement type\fR \fIelement\fR\fR .sp \fIpathName\fR \fBexpand\fR ?\fB-recurse\fR? ?\fIitemDesc ...\fR?\fR .sp \fIpathName\fR \fBidentify\fR \fIx\fR \fIy\fR\fR .sp \fIpathName\fR \fBindex\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem\fR \fIoption\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBitem ancestors\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem bbox\fR \fIitemDesc\fR ?\fIcolumn\fR? ?\fIelement\fR?\fR .sp \fIpathName\fR \fBitem cget\fR \fIitemDesc\fR \fIoption\fR\fR .sp \fIpathName\fR \fBitem children\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem collapse\fR \fIitemDesc\fR ?\fB-recurse\fR?\fR .sp \fIpathName\fR \fBitem compare\fR \fIitemDesc1\fR \fIop\fR \fIitemDesc2\fR\fR .sp \fIpathName\fR \fBitem complex\fR \fIitemDesc\fR \fIlist\fR \fI...\fR\fR .sp \fIpathName\fR \fBitem configure\fR \fIitemDesc\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBitem count\fR\fR .sp \fIpathName\fR \fBitem create\fR ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBitem delete\fR \fIfirst\fR ?\fIlast\fR?\fR .sp \fIpathName\fR \fBitem dump\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem element\fR \fIcommand\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBitem element actual\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR \fIoption\fR\fR .sp \fIpathName\fR \fBitem element cget\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR \fIoption\fR\fR .sp \fIpathName\fR \fBitem element configure\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBitem expand\fR \fIitemDesc\fR ?\fB-recurse\fR?\fR .sp \fIpathName\fR \fBitem firstchild\fR \fIparent\fR ?\fIchild\fR?\fR .sp \fIpathName\fR \fBitem id\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem isancestor\fR \fIitemDesc\fR \fIdescendant\fR\fR .sp \fIpathName\fR \fBitem isopen\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem lastchild\fR \fIparent\fR ?\fIchild\fR?\fR .sp \fIpathName\fR \fBitem nextsibling\fR \fIsibling\fR ?\fInext\fR?\fR .sp \fIpathName\fR \fBitem numchildren\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem order\fR \fIitemDesc\fR ?\fI-visible\fR?\fR .sp \fIpathName\fR \fBitem parent\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem prevsibling\fR \fIsibling\fR ?\fIprev\fR?\fR .sp \fIpathName\fR \fBitem remove\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem rnc\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBitem sort\fR \fIitemDesc\fR ?\fIoption ...\fR?\fR .sp \fIpathName\fR \fBitem state\fR \fIcommand\fR \fIitemDesc\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBitem state forcolumn\fR \fIitemDesc\fR \fIcolumn\fR ?\fIstateDescList\fR?\fR .sp \fIpathName\fR \fBitem state get\fR \fIitemDesc\fR ?\fIstateName ...\fR?\fR .sp \fIpathName\fR \fBitem state set\fR \fIitemDesc\fR ?\fIlastItem\fR? ?\fIstateDescList\fR?\fR .sp \fIpathName\fR \fBitem style\fR \fIcommand\fR \fIitemDesc\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBitem style elements\fR \fIitemDesc\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBitem style map\fR \fIitemDesc\fR \fIcolumn\fR \fIstyle\fR \fImap\fR\fR .sp \fIpathName\fR \fBitem style set\fR \fIitemDesc\fR ?\fIcolumn\fR? ?\fIstyle\fR? ?\fIcolumn style ...\fR?\fR .sp \fIpathName\fR \fBitem text\fR \fIitemDesc\fR \fIcolumn\fR ?\fItext\fR? ?\fIcolumn text ...\fR?\fR .sp \fIpathName\fR \fBitem toggle\fR \fIitemDesc\fR ?\fB-recurse\fR?\fR .sp \fIpathName\fR \fBmarquee\fR \fIoption\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBmarquee anchor\fR ?\fIx y\fR?\fR .sp \fIpathName\fR \fBmarquee cget\fR \fIoption\fR\fR .sp \fIpathName\fR \fBmarquee configure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBmarquee coords\fR ?\fIx1 y1 x2 y2\fR?\fR .sp \fIpathName\fR \fBmarquee corner\fR ?\fIx y\fR?\fR .sp \fIpathName\fR \fBmarquee identify\fR\fR .sp \fIpathName\fR \fBnotify\fR \fIoption\fR ?\fIarg ...\fR?\fR .sp \fIpathName\fR \fBnotify bind\fR ?\fIobject\fR? ?\fIpattern\fR? ?+??\fIscript\fR?\fR .sp \fIpathName\fR \fBnotify configure\fR \fIobject\fR \fIpattern\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBnotify detailnames\fR \fIeventName\fR\fR .sp \fIpathName\fR \fBnotify eventnames\fR\fR .sp \fIpathName\fR \fBnotify generate\fR \fIpattern\fR ?\fIcharMap\fR? ?\fIpercentsCommand\fR?\fR .sp \fIpathName\fR \fBnotify install\fR \fIpattern\fR ?\fIpercentsCommand\fR?\fR .sp \fIpathName\fR \fBnotify install detail\fR \fIeventName\fR \fIdetail\fR ?\fIpercentsCommand\fR?\fR .sp \fIpathName\fR \fBnotify install event\fR \fIeventName\fR ?\fIpercentsCommand\fR?\fR .sp \fIpathName\fR \fBnotify linkage\fR \fIpattern\fR\fR .sp \fIpathName\fR \fBnotify linkage\fR \fIeventName\fR ?\fIdetail\fR?\fR .sp \fIpathName\fR \fBnotify uninstall\fR \fIpattern\fR\fR .sp \fIpathName\fR \fBnotify uninstall detail\fR \fIeventName\fR \fIdetail\fR\fR .sp \fIpathName\fR \fBnotify uninstall event\fR \fIeventName\fR\fR .sp \fIpathName\fR \fBnumcolumns\fR\fR .sp \fIpathName\fR \fBnumitems\fR\fR .sp \fIpathName\fR \fBorphans\fR\fR .sp \fIpathName\fR \fBrange\fR \fIfirst\fR \fIlast\fR\fR .sp \fIpathName\fR \fBstate\fR \fIoption\fR ?\fIstateName\fR?\fR .sp \fIpathName\fR \fBstate define\fR \fIstateName\fR\fR .sp \fIpathName\fR \fBstate linkage\fR \fIstateName\fR\fR .sp \fIpathName\fR \fBstate names\fR\fR .sp \fIpathName\fR \fBstate undefine\fR ?\fIstateName ...\fR?\fR .sp \fIpathName\fR \fBsee\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBselection\fR \fIoption\fR \fIarg\fR\fR .sp \fIpathName\fR \fBselection add\fR \fIfirst\fR ?\fIlast\fR?\fR .sp \fIpathName\fR \fBselection anchor\fR ?\fIitemDesc\fR?\fR .sp \fIpathName\fR \fBselection clear\fR ?\fIfirst\fR? ?\fIlast\fR?\fR .sp \fIpathName\fR \fBselection count\fR\fR .sp \fIpathName\fR \fBselection get\fR\fR .sp \fIpathName\fR \fBselection includes\fR \fIitemDesc\fR\fR .sp \fIpathName\fR \fBselection modify\fR \fIselect\fR \fIdeselect\fR\fR .sp \fIpathName\fR \fBstyle\fR \fIoption\fR ?\fIelement\fR? ?\fIarg arg ...\fR?\fR .sp \fIpathName\fR \fBstyle cget\fR \fIstyle\fR \fIoption\fR\fR .sp \fIpathName\fR \fBstyle configure\fR \fIstyle\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBstyle create\fR \fIstyle\fR ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBstyle delete\fR ?\fIstyle ...\fR?\fR .sp \fIpathName\fR \fBstyle elements\fR \fIstyle\fR ?\fIelementList\fR?\fR .sp \fIpathName\fR \fBstyle layout\fR \fIstyle\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR .sp \fIpathName\fR \fBstyle names\fR\fR .sp \fIpathName\fR \fBtoggle\fR ?\fB-recurse\fR? ?\fIitemDesc ...\fR?\fR .sp \fIpathName\fR \fBxview\fR ?\fIargs\fR?\fR .sp \fIpathName\fR \fBxview\fR\fR .sp \fIpathName\fR \fBxview moveto\fR \fIfraction\fR\fR .sp \fIpathName\fR \fBxview scroll\fR \fInumber\fR \fIwhat\fR\fR .sp \fIpathName\fR \fByview\fR ?\fIargs\fR?\fR .sp \fIpathName\fR \fByview\fR\fR .sp \fIpathName\fR \fByview moveto\fR \fIfraction\fR\fR .sp \fIpathName\fR \fByview scroll\fR \fInumber\fR \fIwhat\fR\fR .sp .BE .SH "DESCRIPTION" .TP \fBtreectrl\fR \fIpathName\fR ?\fIoptions\fR?\fR .PP The \fBtreectrl\fR command creates a new window (given by the \fIpathName\fR argument) and makes it into a treectrl widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the treectrl such as its background color and relief. The \fBtreectrl\fR command returns the path name of the new window. At the time this command is invoked, there must not exist a window named \fIpathName\fR, but \fIpathName\fR's parent must exist. .PP A treectrl is a widget which displays items one per line. Every item has a set of states, which are boolean properties. The item may be spread about one or more columns. For each column of an item there is a style associated, which determines how to display the item's column respecting the item's current state set. One column can be defined to display the data in a hierarchical structure. .PP Normally the origin of the coordinate system is at the upper-left corner of the window containing the treectrl. It is possible to adjust the origin of the coordinate system relative to the origin of the window using the \fBxview\fR and \fByview\fR widget commands; this is typically used for scrolling. .PP A treectrl widget can be horizontal or vertical oriented like many other Tk widgets. For displaying hierarchical data only vertical orientation is useful, since only then the children of an item are displayed directly below their parent. If the treectrl widget is used only to display data in a multicolumn listbox, the specification of an orientation will give useful results. .SH "STANDARD OPTIONS" .TP \fB\fB-background\fR\fR .TP \fB\fB-borderwidth\fR\fR .TP \fB\fB-cursor\fR\fR .TP \fB\fB-font\fR\fR .TP \fB\fB-highlightbackground\fR\fR .TP \fB\fB-highlightcolor\fR\fR .TP \fB\fB-highlightthickness\fR\fR .TP \fB\fB-orient\fR\fR .TP \fB\fB-relief\fR\fR .TP \fB\fB-takefocus\fR\fR .TP \fB\fB-xscrollcommand\fR\fR .TP \fB\fB-yscrollcommand\fR\fR .TP \fB\fB-foreground\fR\fR See the \fBoption\fR manual entry for details on the standard options. .SH "WIDGET SPECIFIC OPTIONS" .LP .nf .ta 6c Command-Line Switch: \fB-backgroundimage\fR Database Name: \fBbackgroundImage\fR Database Class: \fBBackgroundImage\fR .fi .IP Specifies the name of an image to draw as the list background. The image is tiled horizontally and vertically to fill the content area of the list. If the image is transparent it is drawn on top of the background color(s). .LP .nf .ta 6c Command-Line Switch: \fB-backgroundmode\fR Database Name: \fBbackgroundMode\fR Database Class: \fBBackgroundMode\fR .fi .IP Specifies how the background color of items is chosen in each column. The value should be one of \fBrow\fR, \fBcolumn\fR, \fBorder\fR, or \fBordervisible\fR. The default is \fBrow\fR. This option has only an effect for columns which have \fB-itembackground\fR defined as list of two or more colors (see section \fBCOLUMNS\fR below for more on this). If \fBrow\fR or \fBcolumn\fR is specified, the background color is chosen based on the location of the item in the 1- or 2-dimensional grid of items as layed out on the screen; this layout of items is affected by the \fB-orient\fR and \fB-wrap\fR options as well as item visibility. When \fBorder\fR or \fBordervisible\fR is specified, the background color is chosen based on the result of the \fBitem order\fR command, regardless of the layout of items. .LP .nf .ta 6c Command-Line Switch: \fB-buttonbitmap\fR Database Name: \fBbuttonBitmap\fR Database Class: \fBButtonBitmap\fR .fi .IP Specifies the bitmap to be used as the expand/collapse button to the left of an item. This is a per-state option (see \fBPER-STATE OPTIONS\fR). If a bitmap is specified for a certain item state, it overrides the effects of -usetheme. .LP .nf .ta 6c Command-Line Switch: \fB-buttoncolor\fR Database Name: \fBbuttonColor\fR Database Class: \fBButtonColor\fR .fi .IP Specifies the foreground color which should be used for drawing the outline and the plus or minus sign of the button to the left of an item. .LP .nf .ta 6c Command-Line Switch: \fB-buttonimage\fR Database Name: \fBbuttonImage\fR Database Class: \fBButtonImage\fR .fi .IP Specifies the image to be used as the expand/collapse button to the left of an item. This is a per-state option (see \fBPER-STATE OPTIONS\fR). If an image is specified for a certain item state, it overrides the effects of -buttonbitmap and -usetheme. .LP .nf .ta 6c Command-Line Switch: \fB-buttonsize\fR Database Name: \fBbuttonSize\fR Database Class: \fBButtonSize\fR .fi .IP Specifies the diameter of the button drawn to the left of an item in any of the forms acceptable to \fBTk_GetPixels\fR. .LP .nf .ta 6c Command-Line Switch: \fB-buttonthickness\fR Database Name: \fBbuttonThickness\fR Database Class: \fBButtonThickness\fR .fi .IP Specifies the width of the outline and the plus or minus sign of the button to the left of an item in any of the forms acceptable to \fBTk_GetPixels\fR. .LP .nf .ta 6c Command-Line Switch: \fB-columnprefix\fR Database Name: \fBcolumnPrefix\fR Database Class: \fBColumnPrefix\fR .fi .IP Specifies an ascii string that changes the way column ids are reported and processed. If this option is a non-empty string, the usual integer value of a column id is prefixed with the given string. This can aid debugging but it is important your code doesn't assume column ids are integers if you use it. .LP .nf .ta 6c Command-Line Switch: \fB-columnproxy\fR Database Name: \fBcolumnProxy\fR Database Class: \fBColumnProxy\fR .fi .IP If this option specifies a non empty value, it should be a screen distance in any of the forms acceptable to \fBTk_GetPixels\fR. Then a 1 pixel thick vertical line will be drawn at the specified screen distance from the left edge of the treectrl widget, which reaches from top to bottom of the treectrl widget and uses an inverting color (i.e black on lighter background, white on darker background). This line can be used to give the user a visual feedback during column resizing. .LP .nf .ta 6c Command-Line Switch: \fB-columnresizemode\fR Database Name: \fBcolumnResizeMode\fR Database Class: \fBColumnResizeMode\fR .fi .IP Specifies the visual feedback used when resizing columns. The value should be one of \fBproxy\fR or \fBrealtime\fR. For \fBproxy\fR, a 1-pixel thick vertical line is drawn representing where the right edge of the column will be after resizing. For \fBrealtime\fR, the column's size is changed while the user is dragging the right edge of the column. .LP .nf .ta 6c Command-Line Switch: \fB-defaultstyle\fR Database Name: \fBdefaultStyle\fR Database Class: \fBDefaultStyle\fR .fi .IP Specifies a list of styles, one per column, to apply to each item created by the \fBitem create\fR command. The number of styles in the list can be different from the number of tree columns. Each list element should be a valid style name or an empty string to indicate no style should be applied to a specific column. The list of styles is updated if a style is deleted or if a column is moved. .LP .nf .ta 6c Command-Line Switch: \fB-doublebuffer\fR Database Name: \fBdoubleBuffer\fR Database Class: \fBDoubleBuffer\fR .fi .IP Specifies if double-buffering should be used to improve displaying. The value should be one of \fBnone\fR, \fBwindow\fR, or \fBitem\fR. For \fBnone\fR no double-buffering is used at all, which may be most memory efficient, but will probably generate some flickering on the screen. For \fBwindow\fR the complete tree is double-buffered, which requires a buffer big enough to contain the complete widget. For \fBitem\fR, which is the default, every item is separately double-buffered, so it works with a buffer size as big as the biggest item. .LP .nf .ta 6c Command-Line Switch: \fB-height\fR Database Name: \fBheight\fR Database Class: \fBHeight\fR .fi .IP Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. The default is 200 pixel. If this option is less than or equal to zero then the window will not request any size at all. .LP .nf .ta 6c Command-Line Switch: \fB-indent\fR Database Name: \fBindent\fR Database Class: \fBIndent\fR .fi .IP Specifies the amount of indentation in any of the forms acceptable to \fBTk_GetPixels\fR. The default is 19 pixel. Indentation is the screen distance an item is displayed more to the right than its father. .LP .nf .ta 6c Command-Line Switch: \fB-itemheight\fR Database Name: \fBitemHeight\fR Database Class: \fBItemHeight\fR .fi .IP Specifies a fixed height for every item in any of the forms acceptable to \fBTk_GetPixels\fR. If non-zero, this option overrides the requested height of an item and the -minitemheight option. The default is 0, which means that every item has the height requested by the arrangement of elements in each column. Items are never shorter than the maximum height of a button. .LP .nf .ta 6c Command-Line Switch: \fB-itemprefix\fR Database Name: \fBitemPrefix\fR Database Class: \fBItemPrefix\fR .fi .IP Specifies an ascii string that changes the way item ids are reported and processed. If this option is a non-empty string, the usual integer value of an item id is prefixed with the given string. This can aid debugging but it is important your code doesn't assume item ids are integers if you use it. .LP .nf .ta 6c Command-Line Switch: \fB-linecolor\fR Database Name: \fBlineColor\fR Database Class: \fBLineColor\fR .fi .IP Specifies the color which should be used for drawing the connecting lines between related items. .LP .nf .ta 6c Command-Line Switch: \fB-linestyle\fR Database Name: \fBlineStyle\fR Database Class: \fBLineStyle\fR .fi .IP Specifies the style of the connecting lines between related items, should be \fBdot\fR which is the default, or \fBsolid\fR. .LP .nf .ta 6c Command-Line Switch: \fB-linethickness\fR Database Name: \fBlineThickness\fR Database Class: \fBLineThickness\fR .fi .IP Specifies the thickness of the connecting lines between related items in any of the forms acceptable to \fBTk_GetPixels\fR. .LP .nf .ta 6c Command-Line Switch: \fB-minitemheight\fR Database Name: \fBminItemHeight\fR Database Class: \fBMinItemHeight\fR .fi .IP Specifies a minimum height for every item in any of the forms acceptable to \fBTk_GetPixels\fR. The default is 0, which means that every item has the height requested by the arrangement of elements in each column. This option has no effect if the -itemheight option is specified. Items are never shorter than the maximum height of a button. .LP .nf .ta 6c Command-Line Switch: \fB-scrollmargin\fR Database Name: \fBscrollMargin\fR Database Class: \fBScrollMargin\fR .fi .IP The interpretation of this option is left to Tcl scripts that implement scrolling: the widget implementation ignores this option entirely. Defaults to 0. .LP .nf .ta 6c Command-Line Switch: \fB-selectmode\fR Database Name: \fBselectMode\fR Database Class: \fBSelectMode\fR .fi .IP 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 \fBsingle\fR, \fBbrowse\fR, \fBmultiple\fR, or \fBextended\fR; the default value is \fBbrowse\fR. .LP .nf .ta 6c Command-Line Switch: \fB-showbuttons\fR Database Name: \fBshowButtons\fR Database Class: \fBShowButtons\fR .fi .IP Specifies a boolean value that determines whether this widget displays a button to the left of any item. If the button is actually drawn can be configured for every item with the \fBitem hasbutton\fR widget command, but if this option is set to false, the configuration of an item has no effect. The default value is true. .LP .nf .ta 6c Command-Line Switch: \fB-showheader\fR Database Name: \fBshowHeader\fR Database Class: \fBShowHeader\fR .fi .IP Specifies a boolean value that determines whether this widget should display the header line with the column names at the top of the widget. The default value is true. .LP .nf .ta 6c Command-Line Switch: \fB-showlines\fR Database Name: \fBshowLines\fR Database Class: \fBShowLines\fR .fi .IP Specifies a boolean value that determines whether this widget should draw the connecting lines between related items. The default value is true. .LP .nf .ta 6c Command-Line Switch: \fB-showroot\fR Database Name: \fBshowRoot\fR Database Class: \fBShowRoot\fR .fi .IP Specifies a boolean value that determines whether this widget should draw the root item. By suppressing the drawing of the root item the widget can have multiple items that appear as \fItoplevel\fR items. The default value is true. .LP .nf .ta 6c Command-Line Switch: \fB-showrootbutton\fR Database Name: \fBshowRootButton\fR Database Class: \fBShowRootButton\fR .fi .IP Specifies a boolean value that determines whether this widget should draw a button before the root item. The default value is false. .LP .nf .ta 6c Command-Line Switch: \fB-showrootlines\fR Database Name: \fBshowRootLines\fR Database Class: \fBShowRootLines\fR .fi .IP Specifies a boolean value that determines whether this widget should draw the connecting lines between children of the root item. The default value is true. .LP .nf .ta 6c Command-Line Switch: \fB-treecolumn\fR Database Name: \fBtreeColumn\fR Database Class: \fBTreeColumn\fR .fi .IP Specifies an integer value that determines which column displays the data in an hierarchical fashion. Default is 0 meaning that the first column displays the tree. .LP .nf .ta 6c Command-Line Switch: \fB-usetheme\fR Database Name: \fBuseTheme\fR Database Class: \fBUseTheme\fR .fi .IP Specifies a boolean value that determines whether this widget should draw parts of itself using a platform-specific theme manager. The default is false. .LP .nf .ta 6c Command-Line Switch: \fB-width\fR Database Name: \fBwidth\fR Database Class: \fBWidth\fR .fi .IP Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. The default is 200 pixel. If this option is less than or equal to zero then the window will not request any size at all. .LP .nf .ta 6c Command-Line Switch: \fB-wrap\fR Database Name: \fBwrap\fR Database Class: \fBWrap\fR .fi .IP Specifies how to arrange items inside treectrl's window. The value must be an empty string, \fBwindow\fR, or a list with an integer as first element and either \fBitems\fR or \fBpixels\fR as second element. The empty string as wrap mode means that each item appears on exactly one line on the screen. In the other modes multiple items may be displayed in one screen line. In \fBwindow\fR mode a screen line break may occur after any element; in \fBitems\fR mode a line break will only be made after the specified number of items; in \fBpixels\fR mode a line break will only be made after the specified screen distance is reached. .LP .nf .ta 6c Command-Line Switch: \fB-xscrolldelay\fR Database Name: \fBxScrollDelay\fR Database Class: \fBScrollDelay\fR .fi .IP Specifies the amount of time before the default binding should handle repeating mouse motion events in horizontal direction with button 1 pressed. The value should be a list of 1 or 2 integers. The first integer specifies the timespan in microseconds before the active item should be changed to get nearer to the current mouse position. If there are two integers specified, the first is only used for the first motion event, any repeating motion events are handled after the seconds amount of miliseconds is elapsed. .LP .nf .ta 6c Command-Line Switch: \fB-xscrollincrement\fR Database Name: \fBxScrollIncrement\fR Database Class: \fBScrollIncrement\fR .fi .IP Specifies an increment for horizontal scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the horizontal view in the window will be constrained so that the x coordinate at the left edge of the window is always an even multiple of \fB-xscrollincrement\fR; furthermore, the units for scrolling (e.g., the change in view when the left and right arrows of a scrollbar are selected) will also be \fB-xscrollincrement\fR. If the value of this option is less than or equal to zero, then horizontal scrolling is unconstrained. .LP .nf .ta 6c Command-Line Switch: \fB-yscrolldelay\fR Database Name: \fByScrollDelay\fR Database Class: \fBScrollDelay\fR .fi .IP Specifies the amount of time before the default binding should handle repeating mouse motion events in vertical direction with button 1 pressed. The value should be a list of 1 or 2 integers. The first integer specifies the timespan in microseconds before the active item should be changed to get nearer to the current mouse position. If there are two integers specified, the first is only used for the first motion event, any repeating motion events are handled after the seconds amount of miliseconds is elapsed. .LP .nf .ta 6c Command-Line Switch: \fB-yscrollincrement\fR Database Name: \fByScrollIncrement\fR Database Class: \fBScrollIncrement\fR .fi .IP Specifies an increment for vertical scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the vertical view in the window will be constrained so that the y coordinate at the top edge of the window is always an even multiple of \fB-yscrollincrement\fR; furthermore, the units for scrolling (e.g., the change in view when the top and bottom arrows of a scrollbar are selected) will also be \fB-yscrollincrement\fR. If the value of this option is less than or equal to zero, then vertical scrolling is unconstrained. .SH "WIDGET COMMAND" The \fBtreectrl\fR command creates a new Tcl command whose name is the same as the path name of the treectrl's window. This command may be used to invoke various operations on the widget. It has the following general form: .PP \fIpathName\fR \fIoption\fR ?\fIarg arg ...\fR? .PP \fIPathName\fR is the name of the command, which is the same as the treectrl widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for treectrl widgets: .TP \fIpathName\fR \fBactivate\fR \fIitemDesc\fR\fR Sets the active item to the one described by \fIitemDesc\fR, and switches on the state \fBactive\fR for this item. From now on the item can be retrieved with the item description \fBactive\fR. An \fB\fR event is generated. .TP \fIpathName\fR \fBcanvasx\fR \fIscreenx\fR\fR Given a window x-coordinate in the treectrl \fIscreenx\fR, this command returns the treectrl x-coordinate that is displayed at that location. .TP \fIpathName\fR \fBcanvasy\fR \fIscreeny\fR\fR Given a window y-coordinate in the treectrl \fIscreeny\fR, this command returns the treectrl y-coordinate that is displayed at that location. .TP \fIpathName\fR \fBcget\fR \fIoption\fR\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBtree\fR command. .TP \fIpathName\fR \fBcollapse\fR ?\fB-recurse\fR? ?\fIitemDesc ...\fR?\fR Use \fBitem collapse\fR instead. .TP \fIpathName\fR \fBcolumn\fR \fIoption\fR \fIcolumn\fR ?\fIarg ...\fR?\fR This command is used to manipulate the columns of the treectrl widget (see section \fBCOLUMNS\fR below). The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBcolumn\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBcolumn bbox\fR \fIcolumn\fR\fR Returns a list with four elements giving an approximate bounding box for the column header specified by \fIcolumn\fR. If the treectrl is configured to don't display the column headers by means of the \fB-showheader\fR option, an empty list is returned instead. .TP \fIpathName\fR \fBcolumn cget\fR \fIcolumn\fR \fIoption\fR\fR This command returns the current value of the option named \fIoption\fR for the column specified by \fIcolumn\fR, \fIColumn\fR may also be the string \fBtail\fR to specify the tail column. \fIOption\fR may have any of the values accepted by the \fBcolumn configure\fR widget command. .TP \fIpathName\fR \fBcolumn configure\fR \fIcolumn\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies options associated with the column specified by \fIcolumn\fR instead of modifying options for the overall treectrl widget. \fIColumn\fR may be the string \fBtail\fR to specify the tail column. If \fIcolumn\fR is the string \fBall\fR, at least one option-value pair must be given; in this case all the columns are configured. If no \fIoption\fR is specified, the command returns a list describing all of the available options for \fIcolumn\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, 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 \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given option(s) to have the given value(s) for \fIcolumn\fR; in this case the command returns an empty string. .sp See \fBCOLUMNS\fR below for details on the options available for columns. .TP \fIpathName\fR \fBcolumn compare\fR \fIcolumn1\fR \fIop\fR \fIcolumn2\fR\fR From both \fIcolumn\fRs the index is retrieved (as returned from the \fBcolumn order\fR widget command). Then these indexes are compared using the operator \fIop\fR, which must be either \fB<\fR, \fB<=\fR, \fB==\fR, \fB>=\fR, \fB>\fR, or \fB!=\fR. The return value of this command is 1 if the comparison evaluated to true, 0 otherwise. .TP \fIpathName\fR \fBcolumn count\fR\fR Returns a decimal string giving the number of columns created by the \fBcolumn create\fR widget command which haven't been deleted by the \fBcolumn delete\fR widget command. The \fBtail\fR column is not counted. .TP \fIpathName\fR \fBcolumn create\fR ?\fIoption value ...\fR?\fR This command creates a new column in the treectrl widget. The new column is placed to the right of all other columns (except the \fBtail\fR column). Any \fIoption\fR-\fIvalue\fR arguments configure the new column according to the \fBcolumn configure\fR command. The return value is the unique identifier of the new column. .TP \fIpathName\fR \fBcolumn delete\fR \fIcolumn\fR\fR Deletes the specified \fIcolumn\fR from the treectrl widget. If \fIcolumn\fR is the string \fBall\fR, all columns except the tail column are deleted. .TP \fIpathName\fR \fBcolumn dragcget\fR \fIoption\fR\fR .TP \fIpathName\fR \fBcolumn dragconfigure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR The user can move a column within a treectrl by drag-and-drop. Feedback consists of a semi-transparent photo image of the header of the column being dragged and a 2-pixel-thick vertical line to indicate where the column may be dropped. The drag image consists of a colored background rectangle plus the image and/or text displayed in the column header. The 2-pixel-thick line will be drawn over the left edge of the column before which the dragged column may be dropped. .sp The library scripts generate a event when the user has successfully drag-and-drop'd a column. You will have to bind a script to this event if you want to move the dragged column. .sp The following configuration options are supported: .RS .TP \fB\fB-enable\fR\fR \fIboolean\fR Controls whether the user is allowed to rearrange columns by drag-and-drop. .TP \fB\fB-imagealpha\fR\fR \fIalpha\fR \fIAlpha\fR is an integer from 0 (invisible) to 255 (opaque) controlling the transparency of the drag image. Any value outside this range is clipped. .TP \fB\fB-imagecolor\fR\fR \fIbackground\fR \fIBackground\fR is the color of the drag image background rectangle. .TP \fB\fB-imagecolumn\fR\fR \fIcolumn\fR \fIColumn\fR specifies the column to create the drag image from. .TP \fB\fB-imageoffset\fR\fR \fIoffset\fR \fIOffset\fR is the horizontal screen distance the drag image is offset from its starting position. .TP \fB\fB-indicatorcolor\fR\fR \fIcolor\fR \fIColor\fR is the color of the 2-pixel-thick line. .TP \fB\fB-indicatorcolumn\fR\fR \fIcolumn\fR The 2-pixel-thick line will be drawn over the left edge of \fIcolumn\fR. .RE .TP \fIpathName\fR \fBcolumn index\fR \fIcolumn\fR\fR Deprecated. Use \fBcolumn id\fR instead. .TP \fIpathName\fR \fBcolumn id\fR \fIcolumn\fR\fR This command resolves the column description \fIcolumn\fR into a unique column identifier (see \fBCOLUMN DESCRIPTION\fR below). If the column described by \fIcolumn\fR doesn't exist, this command returns an empty string. .TP \fIpathName\fR \fBcolumn list\fR ?\fI-visible\fR?\fR This command returns a list of identifiers for every column (except the tail) from left to right. If \fI-visible\fR is given, only columns whose -visible option is true are returned. .TP \fIpathName\fR \fBcolumn move\fR \fIcolumn\fR \fIbefore\fR\fR Moves the specified \fIcolumn\fR to the left of the column specified by \fIbefore\fR. If \fIbefore\fR is the string \fBtail\fR, the column \fIcolumn\fR will become the last column. .TP \fIpathName\fR \fBcolumn neededwidth\fR \fIcolumn\fR\fR This command returns a decimal string giving the needed width of the column specified by \fIcolumn\fR. The needed width is the maximum of the width of the column header and the width of the \fIwidest\fR currently visible item. .TP \fIpathName\fR \fBcolumn order\fR \fIcolumn\fR ?\fI-visible\fR?\fR This command returns a decimal string giving the position of \fIcolumn\fR in the list of columns starting from zero for the leftmost column. If \fI-visible\fR is given, only columns whose -visible option is true are considered, and -1 is returned if \fIcolumn\fR's -visible option is false. .TP \fIpathName\fR \fBcolumn width\fR \fIcolumn\fR\fR This command returns a decimal string giving the width in pixels of the column specified by \fIcolumn\fR, even if the treectrl is configured to not display the column headers by means of the \fB-showheader\fR option. .RE .TP \fIpathName\fR \fBcompare\fR \fIitemDesc1\fR \fIop\fR \fIitemDesc2\fR\fR Deprecated. Use the \fBitem compare\fR command instead. .TP \fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?\fR Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, 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 \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR 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. \fIOption\fR may have any of the values accepted by the \fBtreectrl\fR command. .TP \fIpathName\fR \fBcontentbox\fR\fR Returns a list with four elements giving an approximate bounding box for the space used to display the items inside the columns, i.e. the space of the treectrl widget without the surrounding borders and the column headers. .TP \fIpathName\fR \fBdebug\fR \fIoption\fR ?\fIarg arg ...\fR?\fR This command is used to facilitate debugging of the treectrl widget. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBdebug\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBdebug cget\fR \fIelement\fR \fIoption\fR\fR This command returns the current value of the debugging option named \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBdebug configure\fR widget command. .TP \fIpathName\fR \fBdebug configure\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies debugging options instead of modifying options for the overall treectrl widget. If no \fIoption\fR is specified, the command returns a list describing all of the available debugging options (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, 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 \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given debugging option(s) to have the given value(s); in this case the command returns an empty string. .sp The following debugging options are supported: .RS .TP \fB\fB-displaydelay\fR\fR \fImillis\fR Specifies a time duration in milliseconds, which should be waited after something has been drawn to the screen. Setting this option has only an effect, if the debugging options \fB-enable\fR and \fB-display\fR are switched on. .TP \fB\fB-data\fR\fR \fIboolean\fR If this option is switched on (together with the debugging option \fB-enable\fR), at various places a consistence check on the internal data structure is made (e.g. for every item is checked, if the registered number of children is equal to the number of child items). If an inconsistency was found, a Tcl background error is raised. .TP \fB\fB-display\fR\fR \fIboolean\fR If this option is switched on (together with the debugging option \fB-enable\fR), at varios places additional debugging output is printed to stdout. .TP \fB\fB-enable\fR\fR \fIboolean\fR All other debugging options only take effect, if this option is also switched on. .TP \fB\fB-erasecolor\fR\fR \fIcolor\fR Use this color, when parts of the treectrl widget should be deleted. If you use an unusual color for this option (like \fBpink\fR), superflous screen redraws can be spotted more easily. Setting this option has only an effect, if the debugging options \fB-enable\fR and \fB-display\fR are switched on. .RE .TP \fIpathName\fR \fBdebug dinfo\fR\fR For every of the treectrl widget a line with some internal valuess info about all items is printed to stdout. The command returns the empty string. .TP \fIpathName\fR \fBdebug scroll\fR\fR Returns a string useful for debugging vertical scrolling. .RE .TP \fIpathName\fR \fBdepth\fR ?\fIitemDesc\fR?\fR If the additional argument \fIitemDesc\fR is specified, returns a decimal string giving the depth of the item describing by \fIitemDesc\fR, whereas depth is defined as the number of steps you must go upward to reach to root item. If no \fIitemDesc\fR is specified, the maximum depth of all items in the treectrl widget is returned instead. .TP \fIpathName\fR \fBdragimage\fR \fIoption\fR ?\fIarg ...\fR?\fR This command is used to manipulate the dragimage, one or more dotted lines around rectangular regions of the treectrl widget. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBdragimage\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBdragimage add\fR \fIitemDesc\fR ?\fIcolumn\fR? ?\fIelement\fR?\fR Adds the shapes of the item described by \fIitemDesc\fR to the shapes of the dragimage. Specifying additional arguments reduces the number of rectangles that are added to the dragimage. If no additional arguments is specified, for every element of the item in every column a dotted rectangles is added. If \fIcolumn\fR is specified, all elements in other columns are ignored. If also \fIelement\fR is specified, only a rectangle for this one element of the specified item in the given column is added. .TP \fIpathName\fR \fBdragimage cget\fR \fIoption\fR\fR This command returns the current value of the dragimage option named \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBdragimage configure\fR widget command. .TP \fIpathName\fR \fBdragimage clear\fR\fR Removes all shapes (if there are any) from the dragimage. This command does not modify the dragimage offset. .TP \fIpathName\fR \fBdragimage configure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies the dragimage options instead of modifying options for the overall treectrl widget. If no \fIoption\fR is specified, the command returns a list describing all of the available dragimage options (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named dragimage option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given dragimage option(s) to have the given value(s); in this case the command returns an empty string. .sp The following dragimage options are supported: .RS .TP \fB\fB-visible\fR\fR \fIboolean\fR Specifies a boolean value which determines whether the dragimage should currently be visible. .RE .TP \fIpathName\fR \fBdragimage offset\fR ?\fIx y\fR?\fR Returns a list containing the x and y offsets of the dragimage, if no additional arguments are specified. The dragimage offset is the screen distance, the image is displayed relative to the item its shape is derived from. If two coordinates are specified, sets the dragimage offset to the given coordinates \fIx\fR and \fIy\fR. .RE .TP \fIpathName\fR \fBelement\fR \fIoption\fR ?\fIelement\fR? ?\fIarg arg ...\fR?\fR This command is used to manipulate elements (see \fBELEMENTS\fR below). The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBelement\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBelement cget\fR \fIelement\fR \fIoption\fR\fR This command returns the current value of the option named \fIoption\fR associated with the element given by \fIelement\fR. \fIOption\fR may have any of the values accepted by the \fBelement configure\fR widget command. .TP \fIpathName\fR \fBelement configure\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies options associated with the element given by \fIelement\fR instead of modifying options for the overall treectrl widget. If no \fIoption\fR is specified, the command returns a list describing all of the available options for \fIelement\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, 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 \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given option(s) to have the given value(s) in \fIelement\fR; in this case the command returns an empty string. See \fBELEMENTS\fR below for details on the options available for elements. .TP \fIpathName\fR \fBelement create\fR \fIelement\fR \fItype\fR ?\fIoption value ...\fR?\fR Create a new elememt in \fIpathName\fR of type \fItype\fR with name \fIelement\fR. The exact format of the arguments after \fItype\fR depends on \fItype\fR, but generally consist of specifications for zero or more element options. See the subsections on individual element types below for more on the syntax of this command. This command returns the name for the new element. .TP \fIpathName\fR \fBelement delete\fR ?\fIelement ...\fR?\fR Deletes each of the named elements and returns an empty string. If an element is deleted while it is still configured as an element of one or more styles by means of the \fBstyle elements\fR widget command, it is also removed from the element lists of these styles. .TP \fIpathName\fR \fBelement names\fR\fR Returns a list containing the names of all existing elements. .TP \fIpathName\fR \fBelement type\fR \fIelement\fR\fR Returns the type of the elements given by \fIelement\fR, such as \fBrect\fR or \fBtext\fR. .RE .TP \fIpathName\fR \fBexpand\fR ?\fB-recurse\fR? ?\fIitemDesc ...\fR?\fR Use \fBitem expand\fR instead. .TP \fIpathName\fR \fBidentify\fR \fIx\fR \fIy\fR\fR Returns a list containing some diagnostics about what is displayed at the given windows coordinates \fIx\fR and \fIy\fR. The resulting list may be empty, if nothing is displayed at the given coordinates, otherwise the first list element is \fBheader\fR or \fBitem\fR. .sp If the coordinates are in the header area and thus the first element of the result is \fBheader\fR, the number of the column or the string \fBtail\fR is the second element in the resulting list; if the x coordinate is near the left or right end of the header, a third element \fBleft\fR or \fBright\fR is added respectively. .sp If the coordinates are below the header area and thus the first element of the result is \fBitem\fR, the numerical id of the item is the second element in the resulting list. If the x coordinate doesn't fall into the column displaying the hierarchical structure, the elements \fBcolumn\fR and the column number are added. If the x coordinate is within the column displaying the hierarchical structure, the following elements are added to the resulting list: \fBline\fR and the numerical id of the item the line comes from, if the x coordinate is above an item connecting line; \fBbutton\fR, if the x coordinate is above a button; \fBcolumn\fR, the column number, \fBelem\fR, and the element name, if the x coordinate is above an element of the item; \fBcolumn\fR and the column number, if the x coordinate is to the right of the elements; nothing otherwise. .TP \fIpathName\fR \fBindex\fR \fIitemDesc\fR\fR Deprecated. Use \fBitem id\fR instead. .TP \fIpathName\fR \fBitem\fR \fIoption\fR ?\fIarg ...\fR?\fR This command is used to manipulate items. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBitem\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBitem ancestors\fR \fIitemDesc\fR\fR Returns a list containing the numerical indexes of all ancestors of the item specified by \fIitemDesc\fR from its parent up to the root item. .TP \fIpathName\fR \fBitem bbox\fR \fIitemDesc\fR ?\fIcolumn\fR? ?\fIelement\fR?\fR Returns a list with four elements giving an approximate bounding box for the item described by \fIitemDesc\fR. If no further argument is specified, the bbox spans the area of the item over all columns. If a \fIcolumn\fR is specified, only the area of the item in this column is considered, if an additional \fIelement\fR is specified, the area of this \fIelement\fR in \fIcolumn\fR of the specified item is returned. .TP \fIpathName\fR \fBitem cget\fR \fIitemDesc\fR \fIoption\fR\fR Returns the current value of the configuration option for the item specified by \fIitemDesc\fR whose name is \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBitem create\fR command when the item was created. .TP \fIpathName\fR \fBitem children\fR \fIitemDesc\fR\fR Returns a list containing the numerical indexes of all children of the item specified by \fIitemDesc\fR in the correct order from the first child to the last child. .TP \fIpathName\fR \fBitem collapse\fR \fIitemDesc\fR ?\fB-recurse\fR?\fR Switches off the \fBopen\fR state of the item(s) described by \fIitemDesc\fR. If the item has descendants, they are no longer displayed. If the item is configured to have a button, the button will now display the image or bitmap configured with the widget options \fB-closedbuttonimage\fR or \fB-closedbuttonbitmap\fR, or a \fI+\fR sign if no image or bitmap is configured. If the item is already closed, this command has no effect. \fIItemDesc\fR may also be the string \fBall\fR, in which case all items of the treectrl widget are collapsed. If \fB-recurse\fR is specified, all descendants of \fIitemDesc\fR will also be collapsed. For every item, that actually will be collapsed, two events are generated: a \fB\fR event before the item state is changed, and a \fB\fR event after the item state was changed. .TP \fIpathName\fR \fBitem compare\fR \fIitemDesc1\fR \fIop\fR \fIitemDesc2\fR\fR From both items described by the \fIitemDesc\fRs the index is retrieved (as returned from the \fBitem order\fR widget command). Then these indexes are compared using the operator \fIop\fR, which must be either \fB<\fR, \fB<=\fR, \fB==\fR, \fB>=\fR, \fB>\fR, or \fB!=\fR. The return value of this command is 1 if the comparison evaluated to true, 0 otherwise. .TP \fIpathName\fR \fBitem complex\fR \fIitemDesc\fR \fIlist\fR \fI...\fR\fR Modifies the elements of the item described by \fIitemDesc\fR. For every column of the treectrl there may be specified one \fIlist\fR, which in turn is an odd elemented list with at least three elements: the name of an element followed by \fIoption\fR-\fIvalue\fR pairs. Every \fIoption\fR must be known by the element's type (see \fBELEMENTS\fR below). The corresponding \fIvalue\fR will overwrite the value of the element for this one column in this item. .TP \fIpathName\fR \fBitem configure\fR \fIitemDesc\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR If no \fIoption\fR is specified, returns a list describing all of the available options for the item given by \fIitemDesc\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR 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 \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR 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. The options and values are the same as those permissible in the \fBitem create\fR command when the item was created. .TP \fIpathName\fR \fBitem count\fR\fR Returns a decimal string giving the number of items created by the \fBitem create\fR widget command which haven't been deleted by the \fBitem delete\fR widget command, plus 1 for the ever-present root item. .TP \fIpathName\fR \fBitem create\fR ?\fIoption value ...\fR?\fR Creates a new item and returns its unique identifier. The new item has the states \fBopen\fR and \fBenabled\fR set by default. If the treectrl widget currently has the focus, the state \fBfocus\fR is also set. Each \fIoption\fR-\fIvalue\fR pair sets one of the configuration options for the item. These same \fIoption\fR-\fIvalue\fR pairs may be used in the \fBitem configure\fR command to change the item's configuration. .sp The following options are supported by items: .RS .TP \fB\fB-button\fR\fR \fIboolean\fR \fIBoolean\fR must have one of the forms accepted by \fBTk_GetBoolean\fR. It indicates whether or not an expand/collapse button should be drawn next to this item, typically to indicate the item has children. The button will only be displayed if: a) the column specified by the widget option \fB-treecolumn\fR is visible; and b) the widget option \fB-showbuttons\fR is true .TP \fB\fB-visible\fR\fR \fIboolean\fR \fIBoolean\fR must have one of the forms accepted by \fBTk_GetBoolean\fR. It indicates that the item should be displayed in the list. The item will only be displayed if: a) each ancestor is a descendant of the root item (not an orphan); and b) each ancestor's \fB-visible\fR option is true .RE .TP \fIpathName\fR \fBitem delete\fR \fIfirst\fR ?\fIlast\fR?\fR Deletes the specified item(s). \fIFirst\fR and \fIlast\fR must be the string \fBall\fR or an \fIitemDesc\fR. If either \fIfirst\fR or \fIlast\fR is specified as \fBall\fR, all items are deleted; if \fIfirst\fR is specified as \fIitemDesc\fR and \fIlast\fR isn't specified, the item described by \fIfirst\fR is deleted. If both \fIfirst\fR and \fIlast\fR are specified, they must decribe items with a common ancestor; then the range of items between \fIfirst\fR and \fIlast\fR is deleted. .sp Deleting an item deletes any child items of the deleted item recursively. If the current \fBactive\fR item is deleted, the root item becomes the new active item. If the current selection \fBanchor\fR item is deleted, the root item becomes the new anchor item. There is no way to delete the root item of the treectrl widget; in all cases the specification of the root item is ignored. .TP \fIpathName\fR \fBitem dump\fR \fIitemDesc\fR\fR Returns a list with six elements in the form \fBindex\fR \fIindex\fR \fBindexVis\fR \fIindexVis\fR \fBneededHeight\fR \fIneededHeight\fR. .TP \fIpathName\fR \fBitem element\fR \fIcommand\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR ?\fIarg ...\fR?\fR This command is used to manipulate elements of the item. The exact behavior of the command depends on the \fIcommand\fR argument that follows the \fBelement\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBitem element actual\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR \fIoption\fR\fR This command returns the current value of the configuration option named \fIoption\fR associated with \fIelement\fR inside \fIcolumn\fR of the item described by \fIitemDesc\fR. If \fIoption\fR was configured using the \fBitem element configure\fR command, the return value is the same as if the \fBitem element cget\fR command was used. Otherwise the value of the configuration option of the underlying element is returned. \fIOption\fR may have any of the values accepted by the type of the specified element (see \fBELEMENTS\fR below) .TP \fIpathName\fR \fBitem element cget\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR \fIoption\fR\fR This command returns the value of the option named \fIoption\fR associated with \fIelement\fR inside \fIcolumn\fR of the item described by \fIitemDesc\fR, if it was already configured for the actual item. \fIOption\fR may have any of the values accepted by the type of the specified element (see \fBELEMENTS\fR below) .TP \fIpathName\fR \fBitem element configure\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies options associated with \fIelement\fR inside \fIcolumn\fR of the item described by \fIitemDesc\fR instead of modifying options for the overall treectrl widget. If no \fIoption\fR is specified, the command returns a list describing all of the available options for the element (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, 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 \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given option(s) to have the given value(s) in the \fIelement\fR inside \fIcolumn\fR of the item described by \fIitemDesc\fR; in this case the command returns an empty string. .RE .TP \fIpathName\fR \fBitem expand\fR \fIitemDesc\fR ?\fB-recurse\fR?\fR Switches on the \fBopen\fR state of the item(s) described by \fIitemDesc\fR. If the item has descendants, they are now displayed. If the item is configured to have a button, the button will now display the image or bitmap configured with the widget options \fB-openbuttonimage\fR or \fB-openbuttonbitmap\fR, or a \fI-\fR sign if no image or bitmap is configured. If the item is already open, this command has no effect. \fIItemDesc\fR may also be the string \fBall\fR, in which case all items of the treectrl widget are expanded. If \fB-recurse\fR is specified, all descendants of \fIitemDesc\fR will also be expanded. For every item, that actually will be expanded, two events are generated: an \fB\fR event before the item state is changed, and an \fB\fR event after the item state was changed. .TP \fIpathName\fR \fBitem firstchild\fR \fIparent\fR ?\fIchild\fR?\fR If \fIchild\fR is not specified, returns the numerical index of the first child of the item described by \fIparent\fR. If \fIchild\fR is specified, it must described an item that is not an ancestor of \fIparent\fR. Then it will become the new first child of \fIparent\fR. .TP \fIpathName\fR \fBitem id\fR \fIitemDesc\fR\fR This command resolves the item description \fIitemDesc\fR into a unique item identifier (see \fBITEM DESCRIPTION\fR below). If the item described by \fIitemDesc\fR doesn't exist, this command returns an empty string. .TP \fIpathName\fR \fBitem isancestor\fR \fIitemDesc\fR \fIdescendant\fR\fR Returns 1 if the item described by \fIitemDesc\fR is a direct or indirect parent of the item decribed by \fIdescendant\fR, 0 otherwise. .TP \fIpathName\fR \fBitem isopen\fR \fIitemDesc\fR\fR Returns 1, if the item described by \fIitemDesc\fR has cuurently the state \fBopen\fR switched on, 0 otherwise. .TP \fIpathName\fR \fBitem lastchild\fR \fIparent\fR ?\fIchild\fR?\fR If \fIchild\fR is not specified, returns the numerical index of the last child of the item described by \fIparent\fR. If \fIchild\fR is specified, it must described an item that is not an ancestor of \fIparent\fR. Then it will become the new last child of \fIparent\fR. .TP \fIpathName\fR \fBitem nextsibling\fR \fIsibling\fR ?\fInext\fR?\fR If \fInext\fR is not specified, returns the numerical index of the next sibling of the item described by \fIsibling\fR. If \fInext\fR is specified, it must described an item that is not an ancestor of \fIsibling\fR. Then it will become the new next sibling of \fIsibling\fR. .TP \fIpathName\fR \fBitem numchildren\fR \fIitemDesc\fR\fR Returns the number of children of the item described by \fIitemDesc\fR. .TP \fIpathName\fR \fBitem order\fR \fIitemDesc\fR ?\fI-visible\fR?\fR This command returns the position of the item \fIitemDesc\fR relative to its toplevel ancestor (usually the root item, unless the ancestor is an orphan). If you imagine all the items flattened into a vertical list, the result of this command is the row the item falls in. If the optional argument \fI-visible\fR is given, only the items whose ancestors are expanded, and whose -visible option is true, get counted; in this case -1 is returned if the item is not visible. .TP \fIpathName\fR \fBitem parent\fR \fIitemDesc\fR\fR Returns the numerical index of the parent of the item described by \fIitemDesc\fR. .TP \fIpathName\fR \fBitem prevsibling\fR \fIsibling\fR ?\fIprev\fR?\fR If \fIprev\fR is not specified, returns the numerical index of the previous sibling of the item described by \fIsibling\fR. If \fIprev\fR is specified, it must described an item that is not an ancestor of \fIsibling\fR. Then it will become the new previous sibling of \fIsibling\fR. .TP \fIpathName\fR \fBitem remove\fR \fIitemDesc\fR\fR Removes the item described by \fIitemDesc\fR from the children list of its father, so that it will become an orphan. .TP \fIpathName\fR \fBitem rnc\fR \fIitemDesc\fR\fR Returns a list of two integers, which corresponds to the row and column of the item described by \fIitemDesc\fR. .TP \fIpathName\fR \fBitem sort\fR \fIitemDesc\fR ?\fIoption ...\fR?\fR Sorts the children of the item described by \fIitemDesc\fR, and redisplays the tree with the items in the new order. .sp The range of items which should be sorted can be restricted by means of the \fB-first\fR and/or \fB-last\fR options, which should be children of the item described by \fIitemDesc\fR; the order between these two limiting items doesn't matter. .sp The sort column can be specified by means of the \fB-column\fR option; this option can be used repeatedly to define a multicolumn sort. The sorting is done by looking at the \fItext\fR of the element specified by the \fB-element\fR option, which must be a text element defined in the style of the sorting column, by default the first text element is used. .sp If the \fB-notreally\fR option is specified, no rearranging of the items is done; instead the sorted items are returned as result of the command. .sp By default ASCII sorting is used with the result returned in increasing order. Any of the following options may be specified to control the sorting process of the previously specified column (unique abbreviations are accepted): .RS .TP \fB\fB-ascii\fR\fR Use string comparison with ASCII collation order. This is the default. .TP \fB\fB-command\fR\fR \fIcommand\fR Use \fIcommand\fR as a comparison command. To compare two items, evaluate a Tcl script consisting of \fIcommand\fR with the numerical ids of the two items appended as additional arguments. The script should return an integer less than, equal to, or greater than zero if the first item is to be considered less than, equal to, or greater than the second, respectively. .TP \fB\fB-decreasing\fR\fR Sort the items in decreasing order ("largest" items first). .TP \fB\fB-dictionary\fR\fR Use dictionary-style comparison. This is the same as \fB-ascii\fR except (a) case is ignored except as a tie-breaker and (b) if two strings contain embedded numbers, the numbers compare as integers, not characters. For example, in \fB-dictionary\fR mode, \fIbigBoy\fR sorts between \fIbigbang\fR and \fIbigboy\fR, and \fIx10y\fR sorts between \fIx9y\fR and \fIx11y\fR. .TP \fB\fB-increasing\fR\fR Sort the items in increasing order ("smallest" items first). This is the default. .TP \fB\fB-integer\fR\fR Convert to integers and use integer comparison. .TP \fB\fB-real\fR\fR Convert to floating-point values and use floating comparison. .RE .TP \fIpathName\fR \fBitem state\fR \fIcommand\fR \fIitemDesc\fR ?\fIarg ...\fR?\fR This command is used to manipulate the states of an item. The exact behavior of the command depends on the \fIcommand\fR argument that follows the \fBstyle\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBitem state forcolumn\fR \fIitemDesc\fR \fIcolumn\fR ?\fIstateDescList\fR?\fR Just like \fBitem state set\fR but manipulates user-defined states for a single item column, not the item as a whole. .TP \fIpathName\fR \fBitem state get\fR \fIitemDesc\fR ?\fIstateName ...\fR?\fR If no \fIstateName\fR is specified, returns a list containing the names of all (predefined and user defined) states which are currently switched on for the item described by \fIitemDesc\fR. If a \fIstateName\fR is specified, 1 is returned if the specified state is currently switched on for the item, 0 otherwise. .TP \fIpathName\fR \fBitem state set\fR \fIitemDesc\fR ?\fIlastItem\fR? ?\fIstateDescList\fR?\fR Every element of \fIstateDescList\fR must describe a user defined state (see \fBSTATES\fR below), with the particularity that the state name may have also a leading \fB~\fR. Every state with a leading \fB!\fR will be switched off for the item described by \fIitemDesc\fR, every state with a leading \fB~\fR will be toggled, and every state without leading \fB!\fR or \fB~\fR will be switched on. If \fIlastItem\fR is specified, the state changes will be made for all items in the range betwen \fIitemDesc\fR and \fIlastItem\fR. \fIItemDesc\fR may be the string \fBall\fR, then the state changes are made for all items of the treectrl widget. .RE .TP \fIpathName\fR \fBitem style\fR \fIcommand\fR \fIitemDesc\fR ?\fIarg ...\fR?\fR This command is used to manipulate the styles of an item. The exact behavior of the command depends on the \fIcommand\fR argument that follows the \fBstyle\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBitem style elements\fR \fIitemDesc\fR \fIcolumn\fR\fR A list is returned containing the currently defined elements of the style, which is set for the item described by \fIitemDesc\fR in \fIcolumn\fR. .TP \fIpathName\fR \fBitem style map\fR \fIitemDesc\fR \fIcolumn\fR \fIstyle\fR \fImap\fR\fR Like the \fBitem style set\fR command, this command may be used to assign a style to a specific column of an item. Unlike \fBitem style set\fR, this command can transfer configuration values of elements in the current style to elements in the new style specified by \fIstyle\fR. \fIMap\fR must be a list of \fIelementOld\fR-\fIelementNew\fR pairs, where \fIelementOld\fR is an element in the current style, and \fIelementNew\fR is an element in the style specified by \fIstyle\fR. Both \fIelementOld\fR and \fIelementNew\fR must be of the same type (\fBbitmap\fR, \fBtext\fR etc). .TP \fIpathName\fR \fBitem style set\fR \fIitemDesc\fR ?\fIcolumn\fR? ?\fIstyle\fR? ?\fIcolumn style ...\fR?\fR If no \fIcolumn\fR is specified, returns a list containing the names of the styles set for all columns of the item described by \fIitemDesc\fR. If no \fIstyle\fR argument is specified, returns the name of the style set for the item described by \fIitemDesc\fR in \fIcolumn\fR. If there are one or more \fIstyle\fR arguments specified, it must be \fIcolumn\fR-\fIstyle\fR pairs; then the style(s) of item in \fIcolumn\fR will be set to \fIstyle\fR. .RE .TP \fIpathName\fR \fBitem text\fR \fIitemDesc\fR \fIcolumn\fR ?\fItext\fR? ?\fIcolumn text ...\fR?\fR If no \fItext\fR argument is specified, returns the text of the first text element in \fIcolumn\fR for the item described by \fIitemDesc\fR. If there are one or more \fItext\fR arguments specified, it must be \fIcolumn\fR-\fItext\fR pairs; then the text(s) of item in \fIcolumn\fR will be set to \fItext\fR. Note that this command is provided as a convenience. Use the \fBitem element configure\fR command if you want to set the text of a specific text element. .TP \fIpathName\fR \fBitem toggle\fR \fIitemDesc\fR ?\fB-recurse\fR?\fR Changes the \fBopen\fR state of the item(s) described by \fIitemDesc\fR. If the state is currently switched off, this command does the same as the \fBitem expand\fR widget command, otherwise the same as the \fBitem collapse\fR widget command. \fIItemDesc\fR may also be the string \fBall\fR, in which case the state of all items of the treectrl widget are toggled. If \fB-recurse\fR is specified, the state of all descendants of \fIitemDesc\fR will also be toggled. .RE .TP \fIpathName\fR \fBmarquee\fR \fIoption\fR ?\fIarg ...\fR?\fR This command is used to manipulate the marquee, a rectangular region of the treectrl widget optionally marked with a surrounding dotted line. One corner point of the marquee is fixed as long as the marquee is visible and called the anchor; the diagonally opposite corner is dragged with the mouse while resizing the marquee and simply called the corner. All coordinates handled by this widget command are treectrl coordinates, i.e. the \fBcanvasx\fR or \fBcanvasy\fR widget command should be used before any window coordinates can be used. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBmarquee\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBmarquee anchor\fR ?\fIx y\fR?\fR Returns a list containing the x and y coordinates of the anchor, if no additional arguments are specified. If two coordinates are specified, sets the anchor to the given coordinates \fIx\fR and \fIy\fR. .TP \fIpathName\fR \fBmarquee cget\fR \fIoption\fR\fR This command returns the current value of the marquee option named \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmarquee configure\fR widget command. .TP \fIpathName\fR \fBmarquee configure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies the marquee options instead of modifying options for the overall treectrl widget. If no \fIoption\fR is specified, the command returns a list describing all of the available marquee options (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named marquee option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given marquee option(s) to have the given value(s); in this case the command returns an empty string. .sp The following marquee options are supported: .RS .TP \fB\fB-visible\fR\fR \fIboolean\fR Specifies a boolean value which determines whether the dotted line surrounding the region of the marquee should currently be visible. .RE .TP \fIpathName\fR \fBmarquee coords\fR ?\fIx1 y1 x2 y2\fR?\fR Returns a list containing the x and y coordinates of the anchor followed by the x and y coordinates of the corner, if no additional arguments are specified. If four coordinates are specified, sets the anchor to the given coordinates \fIx1\fR and \fIy1\fR and the corner to the coordinates \fIx2\fR and \fIy2\fR. .TP \fIpathName\fR \fBmarquee corner\fR ?\fIx y\fR?\fR Returns a list containing the x and y coordinates of the corner, if no additional arguments are specified. If two coordinates are specified, sets the corner to the given coordinates \fIx\fR and \fIy\fR. .TP \fIpathName\fR \fBmarquee identify\fR\fR Returns a list with information about the items inside the marquee. The list has as elements a list itself for every item which is displayed inside the marquee. The first element of these lists is the numerical item id, followed by another list with information about every column of the item inside the marque. These lists start with the column number, followed by the elements of the style defined for the item in this column if there are any. .RE .TP \fIpathName\fR \fBnotify\fR \fIoption\fR ?\fIarg ...\fR?\fR Many Tk widgets communicate with the outside world via \fB-command\fR callbacks and/or virtual events. For example, the Text widget evaluates its \fB-yscrollcommand\fR when the view in the widget changes, and generates a <> virtual event when text is inserted or deleted. A treectrl widget replaces both methods of communication with its own event mechanism accessed through the \fBnotify\fR subcommands. .sp The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBnotify\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBnotify bind\fR ?\fIobject\fR? ?\fIpattern\fR? ?+??\fIscript\fR?\fR This command associates Tcl scripts with events generated by a treectrl widget. If all three arguments are specified, \fBnotify bind\fR will arrange for \fIscript\fR (a Tcl script) to be evaluated whenever the event(s) specified by \fIpattern\fR are generated by this treectrl widget. If \fIscript\fR is prefixed with a "+", then it is appended to any existing binding for \fIpattern\fR; otherwise \fIscript\fR replaces any existing binding. If \fIscript\fR is an empty string then the current binding for \fIpattern\fR is destroyed, leaving \fIpattern\fR unbound. In all of the cases where a script argument is provided, \fBnotify bind\fR returns an empty string. .sp If \fIpattern\fR is specified without a \fIscript\fR, then the script currently bound to \fIpattern\fR is returned, or an empty string is returned if there is no binding for \fIpattern\fR. If neither \fIpattern\fR nor \fIscript\fR is specified, then the return value is a list whose elements are all the patterns for which there exist bindings for \fIobject\fR. .sp The \fIobject\fR argument determines which window(s) the binding applies to. If \fIobject\fR begins with a dot, as in .a.b.c, then it must be the path name for a window; otherwise it may be an arbitrary string. Unlike the regular \fBbind\fR command, bindings on window names are not automatically removed if that window is destroyed. .TP \fIpathName\fR \fBnotify configure\fR \fIobject\fR \fIpattern\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command sets and retrieves options for bindings created by the \fBnotify bind\fR command. .sp If no \fIoption\fR is specified, the command returns a list with \fIoption\fR-\fIvalue\fR pairs describing all the available binding options for \fIpattern\fR on \fIobject\fR. If \fIoption\fR is specified with no \fIvalue\fR, then the command returns the current value of that option. If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given option(s) to have the given value(s) for the binding; in this case the command returns an empty string. .sp The following binding options are supported: .RS .TP \fB\fB-active\fR\fR \fIboolean\fR Specifies if the binding should be active. As long as this option is specified as false, a binding script will not be evaluated when the corresponding event is generated. .RE .TP \fIpathName\fR \fBnotify detailnames\fR \fIeventName\fR\fR Returns a list containing the names of all details, which are installed for the event with the name \fIeventName\fR by means of the \fBnotify install\fR widget command or by the treectrl widget itself. .TP \fIpathName\fR \fBnotify eventnames\fR\fR Returns a list containing the names of all events, which are installed by means of the \fBnotify install\fR widget command or by the treectrl widget itself. .TP \fIpathName\fR \fBnotify generate\fR \fIpattern\fR ?\fIcharMap\fR? ?\fIpercentsCommand\fR?\fR This command causes the treectrl widget to generate an event. This command is typically used to generate dynamic events created by the \fBnotify install\fR command, but may be used to generate static events also. The event specified by \fIpattern\fR is generated, and any active binding scripts on the event are evaluated after undergoing %-substitution. If there are details defined for the event, \fIpattern\fR must describe an <\fIeventName\fR-\fIdetail\fR> pair, otherwise \fIpattern\fR should be <\fIeventName\fR>. .sp The optional \fIcharMap\fR is a list of \fIchar\fR-\fIvalue\fR pairs as in the form returned by \fBarray get\fR. Each \fIchar\fR has to be exactly one character. The \fIcharMap\fR is used in %-substitution. .sp If \fIpercentsCommand\fR is specified, then it will be used to perform %-substitution on any scripts bound to the event. If \fIpercentsCommand\fR is not specified and the event is dynamic, then the %-subtitution command passed to \fBnotify install\fR will be used if it was provided. If the event is static or no %-substitution command is available, then all %-substitution is done using \fIcharMap\fR only . See \fBnotify install\fR for a description of \fIpercentsCommand\fR. .TP \fIpathName\fR \fBnotify install\fR \fIpattern\fR ?\fIpercentsCommand\fR?\fR This command installs a new event or detail specified by \fIpattern\fR. Events created by this command are called dynamic, whereas events created by the treectrl widget itself are called static. This command may be called to set or retrieve the \fIpercentsCommand\fR for an existing dynamic event. .sp The optional \fIpercentsCommand\fR is a list containing the name of a Tcl command, plus any optional arguments, to which five additional arguments will be appended. The command will be called to perform %-substitution on any scripts bound to the event specified by \fIpattern\fR (see \fBEVENTS AND SCRIPT SUBSTITUTIONS\fR). \fIPercentsCommand\fR should be defined as follows: .nf proc percentsCommand {?arg arg ...? char object event detail charMap} { switch -- $char { ... } return $value } .fi The optional \fIarg\fR arguments are part of the \fIpercentsCommand\fR list. \fIChar\fR is the %-character to be substituted. \fIObject\fR is the same as the argument to \fBnotify bind\fR. \fIEvent\fR and \fIdetail\fR specify the event. \fICharMap\fR is the same as the argument to \fBnotify generate\fR. \fIPercentsCommand\fR should return the value to replace the %-character by. If an error occurs evaluating \fIpercentsCommand\fR, the %-character is replaced by itself. .sp \fBnotify install\fR returns the current \fIpercentsCommand\fR for the event, or an error if the event is not dynamic. .TP \fIpathName\fR \fBnotify install detail\fR \fIeventName\fR \fIdetail\fR ?\fIpercentsCommand\fR?\fR This command is for backward compatibility only. Use \fBnotify install\fR with a \fIpattern\fR of <\fIeventName\fR-\fIdetail\fR> instead. .TP \fIpathName\fR \fBnotify install event\fR \fIeventName\fR ?\fIpercentsCommand\fR?\fR This command is for backward compatibility only. Use \fBnotify install\fR with a \fIpattern\fR of <\fIeventName\fR> instead. .TP \fIpathName\fR \fBnotify linkage\fR \fIpattern\fR\fR Returns a string indicating whether the specified event or detail is created by means of the \fBnotify install\fR widget command (\fBdynamic\fR) or by the treectrl widget itself (\fBstatic\fR). .TP \fIpathName\fR \fBnotify linkage\fR \fIeventName\fR ?\fIdetail\fR?\fR This form of this command is for backward compatibility only. Use \fBnotify linkage\fR with a \fIpattern\fR of <\fIeventName\fR> or <\fIeventName\fR-\fIdetail\fR> instead. .TP \fIpathName\fR \fBnotify uninstall\fR \fIpattern\fR\fR If the event or detail specified by \fIpattern\fR is static (i.e. created by the treectrl widget itself), an error is generated. Otherwise the dynamic event or detail is removed. .TP \fIpathName\fR \fBnotify uninstall detail\fR \fIeventName\fR \fIdetail\fR\fR This command is for backward compatibility only. Use \fBnotify uninstall\fR with a \fIpattern\fR of <\fIeventName\fR-\fIdetail\fR> instead. .TP \fIpathName\fR \fBnotify uninstall event\fR \fIeventName\fR\fR This command is for backward compatibility only. Use \fBnotify uninstall\fR with a \fIpattern\fR of <\fIeventName\fR> instead. .RE .TP \fIpathName\fR \fBnumcolumns\fR\fR Deprecated. Use the \fBcolumn count\fR command instead. .TP \fIpathName\fR \fBnumitems\fR\fR Deprecated. Use the \fBitem count\fR command instead. .TP \fIpathName\fR \fBorphans\fR\fR Returns a list containing the numerical ids of all items which has no parent item. An item is created without having a parent, and can later become an orphan again by means of the \fBitem remove\fR widget command. .TP \fIpathName\fR \fBrange\fR \fIfirst\fR \fIlast\fR\fR \fIFirst\fR and \fIlast\fR must be an \fIitemDesc\fR. Returns a list containing the numerical ids of all items in the range between \fIfirst\fR and \fIlast\fR, inclusive. The order between \fIfirst\fR and \fIlast\fR doesn't matter, and the result is always ordered by the increasing index of the items. .TP \fIpathName\fR \fBstate\fR \fIoption\fR ?\fIstateName\fR?\fR This command is used to manipulate the list of user defined states, see section \fBSTATES\fR below. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBstate\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBstate define\fR \fIstateName\fR\fR Defines a new state with the name \fIstateName\fR, which must not be the name of a predefined or already user defined state. .TP \fIpathName\fR \fBstate linkage\fR \fIstateName\fR\fR Returns a string indicating whether the specified state is user defined by means of the \fBstate define\fR widget command (\fBdynamic\fR) or predefined by the treectrl widget itself (\fBstatic\fR). .TP \fIpathName\fR \fBstate names\fR\fR Returns a list containing the names of all user defined states. .TP \fIpathName\fR \fBstate undefine\fR ?\fIstateName ...\fR?\fR Every \fIstateName\fR must be the name of a user defined state. Removes this state from the list of user defined states. .RE .TP \fIpathName\fR \fBsee\fR \fIitemDesc\fR\fR Adjust the view in the treectrl so that the item described by \fIitemDesc\fR is visible. If the item is already visible then the command has no effect; otherwise the treectrl scrolls to bring the item into view, and the corresponding \fB\fR and/or \fB\fR events are generated. .TP \fIpathName\fR \fBselection\fR \fIoption\fR \fIarg\fR\fR This command is used to adjust the selection within a treectrl. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName\fR \fBselection add\fR \fIfirst\fR ?\fIlast\fR?\fR \fIFirst\fR and \fIlast\fR (if specified) must be the string \fBall\fR or an \fIitemDesc\fR. Selects all of the items in the range between \fIfirst\fR and \fIlast\fR, inclusive, without affecting the selection state of items outside that range. If one of the arguments is the string \fBall\fR, all items of the treectrl widget are added to the selection instead. A \fB\fR event is generated. .TP \fIpathName\fR \fBselection anchor\fR ?\fIitemDesc\fR?\fR If \fIitemDesc\fR is specified, the selection anchor is set to the described item. The selection anchor is the end of the selection that is fixed while dragging out a selection with the mouse. The item description \fBanchor\fR may be used to refer to the anchor item. This command doesn't modify the selection state of any item. Returns the numerical id of the selection anchor item. .TP \fIpathName\fR \fBselection clear\fR ?\fIfirst\fR? ?\fIlast\fR?\fR \fIFirst\fR and \fIlast\fR (if specified) must be the string \fBall\fR or an \fIitemDesc\fR. If any of the items between \fIfirst\fR and \fIlast\fR (inclusive) are selected, they are deselected. The selection state is not changed for items outside this range. If no additional arguments is given or one of the arguments is the string \fBall\fR, the selection is completely cleared instead. A \fB\fR event is generated. .TP \fIpathName\fR \fBselection count\fR\fR Returns an integer indicating the number of items in the treectrl that are currently selected. .TP \fIpathName\fR \fBselection get\fR\fR Returns a list containing the numerical ids of all of the items in the treectrl that are currently selected. If there are no items selected in the treectrl then an empty string is returned. .TP \fIpathName\fR \fBselection includes\fR \fIitemDesc\fR\fR Returns 1 if the item indicated by \fIitemDesc\fR is currently selected, 0 if it isn't. .TP \fIpathName\fR \fBselection modify\fR \fIselect\fR \fIdeselect\fR\fR Both arguments \fIselect\fR and \fIdeselect\fR must be the string \fBall\fR or a possibly empty list of \fIitemDesc\fRs. Selects all of the items described by \fIselect\fR, then deselects all items described by \fIdeselect\fR, without affecting the selection state of any item not mentioned in both arguments. If one item is described in both arguments \fIselect\fR and \fIdeselect\fR, it is added to the selection. A \fB\fR event is generated. .RE .TP \fIpathName\fR \fBstyle\fR \fIoption\fR ?\fIelement\fR? ?\fIarg arg ...\fR?\fR This command is used to manipulate styles, which could be considered as a geometry manager for the elements of one item. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBstyle\fR argument. The following forms of the command are supported: .RS .TP \fIpathName\fR \fBstyle cget\fR \fIstyle\fR \fIoption\fR\fR This command returns the current value of the option named \fIoption\fR associated with the style given by \fIstyle\fR. \fIOption\fR may have any of the values accepted by the \fBstyle configure\fR widget command. .TP \fIpathName\fR \fBstyle configure\fR \fIstyle\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies options associated with the style given by \fIstyle\fR instead of modifying options for the overall treectrl widget. If no \fIoption\fR is specified, the command returns a list describing all of the available options for \fIstyle\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, 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 \fIoption\fR is specified). If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given option(s) to have the given value(s) in \fIstyle\fR; in this case the command returns an empty string. .sp The options of a style have effect on all elements managed by the style. The following options are supported: .RS .TP \fB\fB-orient\fR\fR \fIvarName\fR This option specifies which orientation should be used when laying out the elements associated with this style. Must be either \fBhorizontal\fR (the default) or \fBvertical\fR or an abbreviation of one of these. .RE .TP \fIpathName\fR \fBstyle create\fR \fIstyle\fR ?\fIoption value ...\fR?\fR Create a new style in \fIpathName\fR with name \fIstyle\fR. After \fIstyle\fR there may be any number of \fIoption\fR-\fIvalue\fR pairs, each of which sets one of the configuration options for the style. These same \fIoption\fR-\fIvalue\fR pairs may be used in \fBstyle configure\fR widget commands to change the style's configuration. Returns the name of the new style. .TP \fIpathName\fR \fBstyle delete\fR ?\fIstyle ...\fR?\fR Deletes each of the named styles and returns an empty string. If a style is deleted while it is still used to display one or more items, it is also removed from the style list of these items. .TP \fIpathName\fR \fBstyle elements\fR \fIstyle\fR ?\fIelementList\fR?\fR Specifies the elements which should be layed out by this style. Each element of \fIelementList\fR must be the name of an element created by the widget command \fBelement create\fR. Duplicate names in \fIelementList\fR are ignored. An element which was specified in a former call of this command for \fIstyle\fR but is not included in \fIelementList\fR, will be deleted from the elements layed out by \fIstyle\fR. .sp If the \fIelementList\fR argument is not specified, a list is returned containing the currently defined elements of \fIstyle\fR. .TP \fIpathName\fR \fBstyle layout\fR \fIstyle\fR \fIelement\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR This command is similar to the \fBconfigure\fR widget command except that it modifies options used by \fIstyle\fR for laying out \fIelement\fR instead of modifying options for the overall treectrl widget. If no \fIoption\fR is specified, the command returns a list with \fIoption\fR-\fIvalue\fR pairs describing all of the available options for the layout. If \fIoption\fR is specified with no \fIvalue\fR, then the command returns the value of the named option. If one or more \fIoption\fR-\fIvalue\fR pairs are specified, then the command modifies the given option(s) to have the given value(s) for the layout; in this case the command returns an empty string. .sp The options of a layout have effect on exactly the one element \fIelement\fR managed by \fIstyle\fR. The following options are supported: .RS .TP \fB\fB-detach\fR\fR \fIboolean\fR Specifies whether the element should be positioned by itself, i.e. independent from the other elements. .TP \fB\fB-expand\fR\fR \fIstyle\fR .TP \fB\fB-iexpand\fR\fR \fIstyle\fR It can happen that the element's space is larger than its requested dimensions. These options may be used to position (or stretch) the slave within its cell. \fIStyle\fR is a string that contains zero or more of the characters \fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR. Each letter refers to a side (north, south, east, or west) in which direction the element will grow in. .TP \fB\fB-indent\fR\fR \fIboolean\fR Specifies whether the element should be positioned to the right of the button/line area in the tree column. This option is ignored unless the -detach option is true. .TP \fB\fB-ipadx\fR\fR \fIamount\fR .TP \fB\fB-ipady\fR\fR \fIamount\fR \fIAmount\fR specifies how much internal padding to leave on the left and right (for \fB-ipadx\fR) or top and bottom (for \fB-ipady\fR) side of the element. \fIAmount\fR may be a list of two values to specify padding for the two sides separately, it defaults to 0. .TP \fB\fB-padx\fR\fR \fIamount\fR .TP \fB\fB-pady\fR\fR \fIamount\fR \fIAmount\fR specifies how much external padding to leave on the left and right (for \fB-padx\fR) or top and bottom (for \fB-pady\fR) side of the element. \fIAmount\fR may be a list of two values to specify padding for the two sides separately, it defaults to 0. .TP \fB\fB-squeeze\fR\fR \fIstyle\fR If an element's area is smaller than its requested dimensions, this option may be used to allow shrinking of the element. \fIStyle\fR is a string that contains zero or more of the characters \fBx\fR or \fBy\fR. \fBx\fR shrinks the element horizontally, \fBy\fR shrinks it vertically. .TP \fB\fB-union\fR\fR \fIelementList\fR Specifies a list of other \fIelement\fRs, which should be layed out inside the space of this element. .RE .TP \fIpathName\fR \fBstyle names\fR\fR Returns a list containing the names of all existing styles. .RE .TP \fIpathName\fR \fBtoggle\fR ?\fB-recurse\fR? ?\fIitemDesc ...\fR?\fR Use \fBitem toggle\fR instead. .TP \fIpathName\fR \fBxview\fR ?\fIargs\fR?\fR This command is used to query and change the horizontal position of the information displayed in the treectrl's window. It can take any of the following forms: .RS .TP \fIpathName\fR \fBxview\fR\fR 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 tree's area is off-screen to the left, the middle 40% is visible in the window, and 40% of the tree is off-screen to the right. These are the same values passed to scrollbars via the \fB-xscrollcommand\fR option. .TP \fIpathName\fR \fBxview moveto\fR \fIfraction\fR\fR Adjusts the view in the window so that \fIfraction\fR of the total width of the tree is off-screen to the left. \fIFraction\fR must be a fraction between 0 and 1. A \fB\fR event is generated. .TP \fIpathName\fR \fBxview scroll\fR \fInumber\fR \fIwhat\fR\fR This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer. \fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation of one of these. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units of the \fB-xscrollincrement\fR option, if it is greater than zero, or in units of one-tenth the window's width otherwise. If \fIwhat\fR is \fBpages\fR then the view adjusts in units of nine-tenths the window's width. If \fInumber\fR is negative then information farther to the left becomes visible; if it is positive then information farther to the right becomes visible. A \fB\fR event is generated. .RE .TP \fIpathName\fR \fByview\fR ?\fIargs\fR?\fR This command is used to query and change the vertical position of the information displayed in the treectrl's window. It can take any of the following forms: .RS .TP \fIpathName\fR \fByview\fR\fR Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the vertical span that is visible in the window. For example, if the first element is .6 and the second element is 1.0, the lowest 40% of the tree's area is visible in the window. These are the same values passed to scrollbars via the \fB-yscrollcommand\fR option. .TP \fIpathName\fR \fByview moveto\fR \fIfraction\fR\fR Adjusts the view in the window so that \fIfraction\fR of the tree's area is off-screen to the top. \fIFraction\fR is a fraction between 0 and 1. A \fB\fR event is generated. .TP \fIpathName\fR \fByview scroll\fR \fInumber\fR \fIwhat\fR\fR This command adjusts the view in the window up or down according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer. \fIWhat\fR must be either \fBunits\fR or \fBpages\fR. If \fIwhat\fR is \fBunits\fR, the view adjusts up or down in units of the \fB-yscrollincrement\fR option, if it is greater than zero, or in units of one-tenth the window's height otherwise. If \fIwhat\fR is \fBpages\fR then the view adjusts in units of nine-tenths the window's height. If \fInumber\fR is negative then higher information becomes visible; if it is positive then lower information becomes visible. A \fB\fR event is generated. .RE .SH "COLUMNS" A treectrl widget is capable of displaying multiple columns next to each other. An item can be considered as a row, which reaches over all columns. .PP Columns in a treectrl may be specified in a number of ways. See \fBCOLUMN DESCRIPTION\fR below. .PP There is always one special column, the \fBtail\fR column, which fills all space to the right of the last ordinary column. This column has no number; it can only be specified by its tag \fBtail\fR, which cannot be modified. .PP When a column configuration option is specified as \fBper-state\fR, the state names are \fBnormal\fR, \fBactive\fR, \fBpressed\fR or \fBup\fR, i.e. do not use item state names. See \fBPER-STATE OPTIONS\fR for more info. .PP The following options are supported for columns: .TP \fB\fB-arrow\fR\fR \fIdirection\fR Indicates whether or not an arrow should be drawn in the column header to the right of the column title. \fIDirection\fR must have one of the values \fBnone\fR (the default), \fBup\fR, or \fBdown\fR. .TP \fB\fB-arrowbitmap\fR\fR \fIbitmap\fR Specifies as a per-state option the bitmap to use to draw the arrow if this column's -arrow option is not \fBnone\fR. .TP \fB\fB-arrowimage\fR\fR \fIimage\fR Specifies as a per-state option the image to use to draw the arrow if this column's -arrow option is not \fBnone\fR. If an image is specified for a certain state, it overrides the -arrowbitmap option. .TP \fB\fB-arrowside\fR\fR \fIside\fR Indicates on which side an arrow should be drawn, if at all. \fISide\fR must be either \fBleft\fR or \fBright\fR (the default). .TP \fB\fB-arrowgravity\fR\fR \fIside\fR Indicates onto which side an arrow should be packed, if there is more space available for drawing the arrow then needed. \fISide\fR must be either \fBleft\fR (the default) or \fBright\fR. .TP \fB\fB-arrowpadx\fR\fR \fIamount\fR \fIAmount\fR specifies how much padding to leave on the left and right side of the arrow. \fIAmount\fR may be a list of two values to specify padding for left and right separately; it defaults to 6. .TP \fB\fB-arrowpady\fR\fR \fIamount\fR \fIAmount\fR specifies how much padding to leave on the top and bottom of the arrow. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately; it defaults to 0. .TP \fB\fB-bitmap\fR\fR \fIbitmap\fR Specifies the bitmap to display in the element to the left of the column title. .TP \fB\fB-background\fR\fR \fIcolor\fR Specifies as a per-state option the color to use for the background of the column header. .TP \fB\fB-borderwidth\fR\fR \fIsize\fR Specifies a non-negative value indicating the width of the 3-D border to draw around the outside of the column header (if such a border is being drawn; the \fB-relief\fR column option determines this). The value may have any of the forms acceptable to \fBTk_GetPixels\fR. .TP \fB\fB-button\fR\fR \fIboolean\fR Indicates whether or not a mouse click on the column header should change the sorting order of the tree. .TP \fB\fB-expand\fR\fR \fIboolean\fR Indicates whether or not any extra horizontal space should be distributed to this column. This option has no effect if the \fB-width\fR option is set. .TP \fB\fB-font\fR\fR \fIfontName\fR Specifies the font to use for the column title inside the column header. .TP \fB\fB-image\fR\fR \fIimage\fR Specifies the image to display in the element to the left of the column title. This option overrides the \fB-bitmap\fR column option. .TP \fB\fB-imagepadx\fR\fR \fIamount\fR \fIAmount\fR specifies how much padding to leave on the left and right side of the image. \fIAmount\fR may be a list of two values to specify padding for left and right separately; it defaults to 6. .TP \fB\fB-imagepady\fR\fR \fIamount\fR \fIAmount\fR specifies how much padding to leave on the top and bottom of the image. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately; it defaults to 0. .TP \fB\fB-itembackground\fR\fR \fIcolorList\fR Specifies a list of colors, which should be used as alternating background color for the items of this column. See also the \fB-backgroundmode\fR widget option for more on this. .TP \fB\fB-justify\fR\fR \fIjustification\fR This option determines how the items (and the title) line up with each other. Must be one of \fBleft\fR (the default), \fBcenter\fR, or \fBright\fR. .TP \fB\fB-maxwidth\fR\fR \fIsize\fR Specifies the maximum size, in screen units, that will be permitted for this column. If \fIsize\fR is an empty string, then there is no limit on the maximum size of the column. This option has no effect if the \fB-width\fR option is set. .TP \fB\fB-minwidth\fR\fR \fIsize\fR Specifies the minimum size, in screen units, that will be permitted for this column. If \fIsize\fR is an empty string, then the minimum size of the column is zero. This option has no effect if the \fB-width\fR option is set. .TP \fB\fB-resize\fR\fR \fIboolean\fR Specifies a boolean value that indicates whether the user should be allowed to resize the column by dragging the right edge of the column's header. Default is true. .TP \fB\fB-squeeze\fR\fR \fIboolean\fR Specifies a boolean value that indicates whether or not the column should shrink when the content width of the treectrl is less than the total needed width of all visible columns. Defaults to false, which means the column will not get smaller than its needed width. The column will not get smaller than the value of its \fB-minwidth\fR option, if specified. This option has no effect if the \fB-width\fR option is set. .TP \fB\fB-state\fR\fR \fIstate\fR Specifies one of three states for the column header: \fBnormal\fR, \fBactive\fR, or \fBpressed\fR. The active state is used when the mouse is over the header. The pressed state is used when the mouse button is pressed in the header. .TP \fB\fB-stepwidth\fR\fR \fIsize\fR Specifies a sort of tabbed alignment for columns that displays more than one item next to each other (typically in a treectrl widget with horizontal orientation). Every item will get an x-coordinate which is a multiple of \fIsize\fR. .TP \fB\fB-tag\fR\fR \fItag\fR Defines a unique name for the column which can be used whenever a column must be specified. .TP \fB\fB-text\fR\fR \fItext\fR Specifies a text to be displayed inside the column title. .TP \fB\fB-textcolor\fR\fR \fIcolor\fR Specifies a color, which should be used as foreground color to display the column title. .TP \fB\fB-textlines\fR\fR \fIcount\fR Specifies the maximum number of lines of text to display in the column title. If this value is zero, the number of lines displayed is determined by any newline characters and the effects of wrapping when the column width is less than needed. The default is 1. Note: Under OSX this value is always set to 1 when the treectrl's \fB-usetheme\fR option is true, because the Appearance Manager uses a fixed height for the column header; there is only room for a single line of text. .TP \fB\fB-textpadx\fR\fR \fIamount\fR \fIAmount\fR specifies how much padding to leave on the left and right side of the text. \fIAmount\fR may be a list of two values to specify padding for left and right separately; it defaults to 6. .TP \fB\fB-textpady\fR\fR \fIamount\fR \fIAmount\fR specifies how much padding to leave on the top and bottom of the text. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately; it defaults to 0. .TP \fB\fB-visible\fR\fR \fIboolean\fR Indicates whether or not the column should be displayed. .TP \fB\fB-width\fR\fR \fIsize\fR Specifies a fixed width for the column. If this value is an empty string, the column width is calculated as the maximum of: a) the width requested by items; b) the width requested by the column's header; and c) the column's \fB-minwidth\fR option. This calculated width is also affected by the \fB-expand\fR option and the \fB-squeeze\fR option. In any case, the calculated width will not be greater than the \fB-maxwidth\fR option, if specified. .TP \fB\fB-widthhack\fR\fR \fIboolean\fR Indicates whether or not all items should have the same width. This option only has effect when all of these conditions are met: a) the treectrl's \fB-orientation\fR option is \fBvertical\fR; b) only a single column is visible; c) the single visible column's \fB-width\fR option is an empty string; and d) the treectrl's \fB-wrap\fR option results in wrapping. .SH "COLUMN DESCRIPTION" Many of the commands and options for a treectrl take as an argument a description of which column to operate on. See the \fBEXAMPLES\fR section for examples. The initial part of a column description must begin with one of the following terms: .TP \fIid\fR Specifies the unique column identifier, where \fIid\fR should be the return value of a prior call of the \fBcolumn create\fR widget command. .TP \fItag\fR Specifies the value of a column's -tag option. .TP \fBall\fR Indicates every column, including the tail column. Not all commands accept this. .TP \fBfirst\fR ?\fBvisible\fR? Indicates the leftmost column of the treectrl. If \fBvisible\fR is specified, the leftmost column whose -visible option is true is used. .TP \fBlast\fR ?\fBvisible\fR? Indicates the rightmost column of the treectrl (but not the tail column). If \fBvisible\fR is specified, the rightmost column whose -visible option is true is used. .TP \fBorder\fR \fIn\fR ?\fBvisible\fR? Indicates the \fIn\fRth column in the list of columns as returned by the \fBcolumn order\fR command. .TP \fBtail\fR Indicates the ever-present tail column of the treectrl. .TP \fBtree\fR Indicates the column specified by the -treecolumn option of the treectrl. .PP The initial part of the column description (matching any of the values above) may be followed by one or more \fImodifier\fRs. A modifier changes the column used relative to the description up to this point. It may be specified in any of the following forms: .TP \fBnext\fR ?\fBvisible\fR? Use the column to the right, or the column to the right whose -visible option is true. .TP \fBprev\fR ?\fBvisible\fR? Use the column to the left, or the column to the left whose -visible option is true. .SH "STATES" A state consists basically of just a string: its \fIstateName\fR. For every item a set of these states is managed, which means that every item can have every state switched on or off. The following states are predefined for every item: .TP \fBactive\fR At every time this state is set for exactly one item, which therefore is called the active item. When the treectrl widget is created or when the active item is deleted, the root item will become the active element. This state can be modified by means of the widget command \fBactivate\fR. .TP \fBenabled\fR This state is set for every item, when it is created. It cannot be modified. .TP \fBfocus\fR This state is set for every item, if the treectrl widget has currently the focus. It cannot be modified by means of a widget command, but is maintained as reaction of a or event. .TP \fBopen\fR If this state is switched on, the descendants of the item are displayed - the item is expanded. If this state is switched off, the descendants of the item are not displayed - the item is collapsed. For a new item this state is switched on. It can be modified by means of the widget commands \fBitem expand\fR, \fBitem collapse\fR, or \fBitem toggle\fR. .TP \fBselected\fR This state is set for every item, which is included in the selection. It can be modified by means of the widget command \fBselection\fR. .PP By means of the \fBstate define\fR widget command up to 27 additional \fIstateName\fRs can be defined. .PP Some widget commands expect a \fIstateDesc\fR argument, which is a \fIstateName\fR optionally preceded by an exclamation mark (\fB!\fR). If the \fIstateName\fR has no leading \fB!\fR it describes a currently switched on state, if it has a leading \fB!\fR it describes a currently switched off state. .PP Some widget commands expect a \fIstatePattern\fR argument, which should be a non empty list of \fIstateDesc\fRs. The pattern matches, if for every element of the list the \fIstateDesc\fR describes the same state as the item currently has. .SH "PER-STATE OPTIONS" The visual appearance of an item can change depending on the state the item is in, such as being the active item, being included in the selection, being collapsed, or some combination of those or other states. When a configuration option is described as \fBper-state\fR, it means the option describes a value which varies depending on the state of the item. If a per-state option is specified as a single value, the value is used for all states. Otherwise the per-state option must be specified as an even-numbered list. For example, to use the font "Times 12 bold" in a \fBtext\fR element regardless of the item state you can write: .nf $T element configure MyTextElement -font {{Times 12 bold}} .fi However, to use a different font when the item is selected you could write: .nf $T element configure MyTextElement -font {{Courier 10} selected {Times 12 bold} {}} .fi In the example above, the -font option reads "value stateList value stateList". If \fIstateList\fR is an empty list, the preceding \fIvalue\fR is used regardless of the item state. A non-empty stateList specifies a list of states which must be set for the item in order to use the preceding value. Each stateList can also include state names preceded by a ! sign, indicating the state must *not* be set for the item. For example: .nf $T element configure MyRectElement -fill {blue {selected focus} gray {selected !focus}} .fi In the example above, the \fBrect\fR element is filled with blue when the treectrl has the focus and the item is selected. If the treectrl does not have the focus, the example specifies that gray should be used for selected items. Also note that if the item is not selected, no color is specified for the -fill option. .SH "ELEMENTS" Elements are the smallest building blocks which are handled by a treectrl widget. One or more elements together can be combined to a style, which can be considered as a blueprint for an item. An element can be of type \fBbitmap\fR, \fBborder\fR, \fBimage\fR, \fBrect\fR, \fBtext\fR or \fBwindow\fR. For each element type there is a section below describing the options which can modify an element of that type. .PP There are some options which can be configured to get different values dependent on the state of the item in which their element is included. The values of these options are basically a list. If the list has one element, the value is valid regardless of the item state. A list with an even number of elements (\fIvalue\fR-\fIstatePattern\fR pairs) specifies different values for different states. For acceptable values of \fIstatePattern\fR see the section \fBSTATES\fR above. The last \fIstatePattern\fR can be empty, implementing a sort of \fIotherwise clause\fR. The options with this behaviour are called \fIper-state options\fR. .SH "BITMAP ELEMENT" An element of type \fBbitmap\fR can be used to display a bitmap in an item. The following options are supported for bitmap elements: .TP \fB\fB-background\fR\fR \fIcolor\fR Specifies as a per-state option the color to use for each of the bitmap's '0' valued pixels. .TP \fB\fB-bitmap\fR\fR \fIbitmap\fR Specifies as a per-state option the bitmap to display in the element. .TP \fB\fB-draw\fR\fR \fIboolean\fR Specifies as a per-state option whether to draw the element. If the value is unspecified (the default), the element will be drawn. .TP \fB\fB-foreground\fR\fR \fIcolor\fR Specifies as a per-state option the color to use for each of the bitmap's '1' valued pixels. .SH "BORDER ELEMENT" An element of type \fBborder\fR can be used to add a border to an item. The following options are supported for border elements: .TP \fB\fB-background\fR\fR \fIcolor\fR Specifies as a per-state option the color to use for the background of the border. .TP \fB\fB-draw\fR\fR \fIboolean\fR Specifies as a per-state option whether to draw the element. If the value is unspecified (the default), the element will be drawn. .TP \fB\fB-filled\fR\fR \fIboolean\fR Specifies whether the interior of the border should also be filled with the specified background color. Default to false, which means that the background color of the tree is visible between the borders. .TP \fB\fB-height\fR\fR \fIsize\fR Specifies the height of the area of the border. .TP \fB\fB-relief\fR\fR \fIreliefList\fR Specifies as a per-state option relief of the border. For acceptable values see the description of the \fB-relief\fR option in the \fBoptions\fR manual page. .TP \fB\fB-thickness\fR\fR \fIthickness\fR Specifies the thickness of the border. .TP \fB\fB-width\fR\fR \fIsize\fR Specifies the width of the area of the border. .SH "IMAGE ELEMENT" An element of type \fBimage\fR can be used to display an image in an item. The following options are supported for image elements: .TP \fB\fB-draw\fR\fR \fIboolean\fR Specifies as a per-state option whether to draw the element. If the value is unspecified (the default), the element will be drawn. .TP \fB\fB-height\fR\fR \fIsize\fR Specifies the height of the image. .TP \fB\fB-image\fR\fR \fIimage\fR Specifies as a per-state option the image to display in the element. .TP \fB\fB-width\fR\fR \fIsize\fR Specifies the width of the image. .SH "RECTANGLE ELEMENT" An element of type \fBrect\fR can be used to display a rectangle in an item. The following options are supported for rectangle elements: .TP \fB\fB-draw\fR\fR \fIboolean\fR Specifies as a per-state option whether to draw the element. If the value is unspecified (the default), the element will be drawn. .TP \fB\fB-fill\fR\fR \fIfillColor\fR Specifies as a per-state option the color to be used to fill rectangle's area. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR is an empty string (the default), then the rectangle will not be filled. .TP \fB\fB-height\fR\fR \fIsize\fR Specifies the height of the rectangle. .TP \fB\fB-open\fR\fR \fIopen\fR This option may be used to get an incomplete drawing of the outline. \fIOpen\fR is a string that contains zero or more of the characters \fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR. Each letter refers to a side (north, south, east, or west) that the outline will not be drawn. The default is the empty string, which causes the outline to be drawn completely. .TP \fB\fB-outline\fR\fR \fIoutlineColor\fR Specifies as a per-state option the color that should be used to draw the outline of the rectangle. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR is specified as an empty string (the default), then no outline is drawn for the rectangle. .TP \fB\fB-outlinewidth\fR\fR \fIoutlineWidth\fR Specifies the width of the outline to be drawn around the rectangle's region. \fIoutlineWidth\fR may be in any of the forms acceptable to \fBTk_GetPixels\fR. If the \fB-outline\fR option has been specified as an empty string (the default), then no outline is drawn. .TP \fB\fB-showfocus\fR\fR \fIboolean\fR Specifies a boolean value indicating whether a "focus ring" should be drawn around the rectangle, if the item containing the rectangle is the active item and the treectrl widget has currently the focus. .TP \fB\fB-width\fR\fR \fIsize\fR Specifies the width of the rectangle. .SH "TEXT ELEMENT" An element of type \fBtext\fR can be used to display a text in an item. The following options are supported for text elements: .TP \fB\fB-draw\fR\fR \fIboolean\fR Specifies as a per-state option whether to draw the element. If the value is unspecified (the default), the element will be drawn. .TP \fB\fB-data\fR\fR \fIdata\fR Specifies raw data to be printed as text. .TP \fB\fB-datatype\fR\fR \fIdataType\fR Specifies the datatype which should be used to convert the value of the \fB-data\fR option to the text to be printed. Acceptable values are \fBdouble\fR, \fBinteger\fR, \fBlong\fR, \fBstring\fR, or \fBtime\fR. .TP \fB\fB-fill\fR\fR \fIcolor\fR Specifies as a per-state option the color to be used as foreground color of the text. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR is an empty string (the default), then the text will be displayed with the color specified as foreground color of the treectrl widget. .TP \fB\fB-format\fR\fR \fIformat\fR This option overwrites the default format choosen by means of the \fB-datatype\fR option. For a datatype \fBtime\fR \fIformat\fR should be a valid format string for the \fBclock\fR command, for all other datatypes it should be a valid format element of the \fBformat\fR command. .TP \fB\fB-font\fR\fR \fIfontName\fR Specifies as a per-state option the font to use for the text. \fIFontName\fR may be any string acceptable to \fBTk_GetFont\fR. If this option isn't specified, it defaults to the font configured for the treectrl widget. .TP \fB\fB-justify\fR\fR \fIhow\fR Specifies how to justify the text within its bounding region. \fIHow\fR must be one of the values \fBleft\fR, \fBright\fR, or \fBcenter\fR. This option will only matter if the text is displayed as multiple lines. If the option is omitted, it defaults to \fBleft\fR. .TP \fB\fB-lines\fR\fR \fIlineCount\fR Specifies the maximal number of lines the text should be printed. If the doesn't fit into the area of \fIlineCount\fR lines with the configured width, it will be truncated at the right end and filled up with an ellipsis. .TP \fB\fB-text\fR\fR \fIstring\fR \fIString\fR specifies the characters to be displayed by the element. Non printable characters are displayed in their escaped form (e.g. a new line character is displayed as the two characters \fB\\n\fR). If this option is specified, any values of \fB-data\fR, \fB-datatype\fR, and \fB-format\fR are ignored. .TP \fB\fB-textvariable\fR\fR \fIvarName\fR Specifies the name of a variable. The value of the variable is a text string to be displayed by the element; if the variable value changes then the element will automatically update itself to reflect the new value. .TP \fB\fB-width\fR\fR \fIsize\fR Specifies the width of the area of the text. .TP \fB\fB-wrap\fR\fR \fImode\fR \fIMode\fR specifies how to handle lines that are wider than the text's area. Acceptable values are \fBchar\fR or \fBword\fR. .SH "WINDOW ELEMENT" An element of type \fBwindow\fR can be used to display a Tk window in an item. The following options are supported for window elements: .TP \fB\fB-window\fR\fR \fIpathName\fR Specifies the window to associate with this element. The window specified by \fIpathName\fR must either be a child of the treectrl widget or a child of some ancestor of the treectrl widget. \fIPathName\fR may not refer to a top-level window. This option cannot be specified by the \fBelement create\fR or \fBelement configure\fR commands, only by the \fBitem element configure\fR command; i.e., the element must be associated with a particular item. .SH "ITEM DESCRIPTION" Many of the commands and options for a treectrl take as an argument a description of which item to operate on. See the \fBEXAMPLES\fR section for examples. The initial part of an item description must begin with one of the following terms: .TP \fIid\fR Specifies the unique item identifier, where \fIid\fR should be the return value of a prior call of the \fBitem create\fR widget command, or \fB0\fR to specify the ever-present root item. .TP \fBactive\fR Indicates the item that is currently active, i.e. normally the item specified as argument of the last successful \fBactivate\fR widget command, or the root item if no such call happened yet. .TP \fBanchor\fR Indicates the anchor item of the selection, i.e. normally the item specified as argument of the last successful \fBselection anchor\fR widget command, or the root item if no such call happened yet. .TP \fBfirst\fR ?\fBvisible\fR? Indicates the first item of the treectrl, i.e. the root item. If \fBvisible\fR is specified and the widget is configured with \fB-showroot\fR \fBno\fR, the first visible child of the root node is specified instead. .TP \fBlast\fR ?\fBvisible\fR? Indicates the last item of the treectrl. If \fBvisible\fR is specified and the last item is currently not visible, i.e. one of its father nodes is collapsed, the last visible item is specified instead. .TP \fBnearest\fR \fIx y\fR Indicates the item nearest to the point given by \fIx\fR and \fIy\fR. .TP \fBrnc\fR \fIrow column\fR Indicates the item in the given \fIrow\fR and \fIcolumn\fR. You can memorize \fBrnc\fR as abbreviation of "row 'n' column". .TP \fBroot\fR Indicates the root item of the treectrl. .PP The initial part of the item description (matching any of the values above) may be followed by one or more \fImodifier\fRs. A modifier changes the item used relative to the description up to this point. It may be specified in any of the following forms: .TP \fBabove\fR Use the item one row above in this column. .TP \fBbelow\fR Use the item one row below in this column. .TP \fBbottom\fR Use the item in the last row of this column. .TP \fBchild\fR \fIn\fR ?\fBvisible\fR? Use the \fIn\fRth child of the item. .TP \fBfirstchild\fR ?\fBvisible\fR? Use the first child of the item. .TP \fBlastchild\fR ?\fBvisible\fR? Use the last child of the item. .TP \fBleft\fR Use the item one column to the left in the same row. .TP \fBleftmost\fR Use the item of the first column in the same row. .TP \fBnext\fR ?\fBvisible\fR? Use the next item, which is the first existant (or visible) item of the following list: the first child, the next sibling or the next sibling of the nearest parent which has one. .TP \fBnextsibling\fR ?\fBvisible\fR? Use the next sibling of the item. .TP \fBparent\fR Use the parent of the item. .TP \fBprev\fR ?\fBvisible\fR? Use the last child of the previous sibling, or the parent if there is no previos sibling. .TP \fBprevsibling\fR ?\fBvisible\fR? Use the previous sibling of the item. .TP \fBright\fR Use the item one column to the right in the same row. .TP \fBrightmost\fR Use the item of the last column in the same row. .TP \fBsibling\fR \fIn\fR ?\fBvisible\fR? Use the \fIn\fRth child of the item's parent. .TP \fBtop\fR Use the item in the first row of this column. .SH "EVENTS AND SCRIPT SUBSTITUTIONS" The \fIscript\fR argument to \fBnotify bind\fR is a Tcl script, which will be evaluated whenever the given event is generated. \fIScript\fR will be executed in the same interpreter that the \fBnotify bind\fR command was executed in, and it will run at global level (only global variables will be accessible). If \fIscript\fR contains any \fB%\fR characters, then the script will not be evaluated directly. Instead, a new script will be generated by replacing each \fB%\fR, and the character following it, with information from the current event. Unlike the regular Tk \fBbind\fR mechanism, each event generated by a treectrl widget has its own set of %-substitutions. .PP The following %-substitutions are valid for all static events: .TP \fB%%\fR Replaced with a single % .TP \fB%d\fR The detail name .TP \fB%e\fR The event name .TP \fB%P\fR The pattern, either or .TP \fB%W\fR The object argument to the \fBnotify bind\fR command .TP \fB%T\fR The treectrl widget which generated the event .TP \fB%?\fR A list of the format {char value char value ...} for each %-substitution character and the value it is replaced by .PP The following events may be generated by a treectrl widget: .TP \fB\fR Generated whenever the active item changes. .RS .TP \fB%c\fR The current active item .TP \fB%p\fR The previous active item .RE .TP \fB\fR Generated before an item is collapsed. .RS .TP \fB%I\fR The item id .RE .TP \fB\fR Generated after an item is collapsed. .RS .TP \fB%I\fR The item id .RE .TP \fB\fR Generated before an item is expanded. This event is useful if you want to add child items to the item just before the item is expanded. .RS .TP \fB%I\fR The item id .RE .TP \fB\fR Generated after an item is expanded. .RS .TP \fB%I\fR The item id .RE .TP \fB\fR Generated when items are about to be deleted by the \fBitem delete\fR command. .RS .TP \fB%i\fR List of items ids being deleted. .RE .TP \fB\fR Generated whenever the view in the treectrl changes in such a way that a horizontal scrollbar should be redisplayed. .RS .TP \fB%l\fR Same as the first fraction appended to \fB-xscrollcommand\fR. Think \fIlower\fR. .TP \fB%u\fR Same as the second fraction appended to \fB-xscrollcommand\fR. Think \fIupper\fR. .RE .TP \fB\fR Generated whenever the view in the treectrl changes in such a way that a vertical scrollbar should be redisplayed. .RS .TP \fB%l\fR Same as the first fraction appended to \fB-yscrollcommand\fR. Think \fIlower\fR. .TP \fB%u\fR Same as the second fraction appended to \fB-yscrollcommand\fR. Think \fIupper\fR. .RE .TP \fB\fR Generated whenever the selection changes. This event gives information about how the selection changed. .RS .TP \fB%c\fR Same as the \fBselection count\fR widget command .TP \fB%D\fR List of newly-deselected item ids .TP \fB%S\fR List of newly-selected item ids .RE .SH "DYNAMIC EVENTS" In addition to the pre-defined static events such as and , new dynamic events can be created by using the \fBnotify install\fR command. .PP The following events may be generated by the library scripts: .TP \fB\fR .TP \fB\fR .TP \fB\fR Generated whenever the user drag-and-drops a column header. The library scripts do not actually move a dragged column. You must bind to the receive event to move the column. See \fBEXAMPLES\fR. .RS .TP \fB%C\fR The column that was dragged .TP \fB%b\fR The column to move the dragged column before .RE .TP \fB\fR .TP \fB\fR .TP \fB\fR Generated whenever the user drag-and-drops a file into a directory. This event is generated by the filelist-bindings.tcl library code, which is not used by default. See the "Explorer" demos. .RS .TP \fB%I\fR The item that the user dropped the dragged items on. .TP \fB%l\fR (lowercase L) The list of dragged items. .RE .TP \fB\fR The filelist-bindings.tcl code will display a text-editing window if the user clicks on a selected file/folder name. See the "Explorer" demos. .RS .TP \fB%I\fR The item containing the edited text element .TP \fB%C\fR The column containing the edited text element .TP \fB%E\fR The name of the edited text element .TP \fB%t\fR The edited text .RE .TP \fB\fR Generated whenever the user clicks and releases the left mouse button in a column header if the column's -button option is true. You can bind a script to this event to sort the list. .RS .TP \fB%C\fR The column whose header was clicked .RE The library scripts provide an example of using a dynamic event called , which is generated when the mouse button is released over a column header. .nf treectrl .t .t notify install .t notify bind ConsoleTag { puts "header %C clicked in treectrl %T" } proc ::TreeCtrl::Release1 {w x y} { ... $w notify generate [list C $Priv(column)] \\ [list ::TreeCtrl::PercentsCmd $w] ... } .fi In the example a new treectrl widget is created and the event is installed. For convenience there is no \fIpercentsCommand\fR argument to \fBnotify install\fR; instead the call to \fBnotify generate\fR specifies the %-substitution command. A script is bound to the event with \fBnotify bind\fR which will print out the column number and widget name to the console (in the demos, is used to sort the list based on the column that was clicked). The \fIcharMap\fR argument to \fBnotify generate\fR provides a list of %-substitution characters and values which is used by ::TreeCtrl::PercentsCmd. In this example any %C in any script bound to the event will be replaced by the value of $Priv(column). .SH "DEFAULT BINDINGS" Tk automatically creates class bindings for treectrl widgets that give them the following default behavior. .IP [1] Clicking mouse button 1 over an item positions the active cursor on the item, sets the input focus to this widget, and resets the selection of the widget to this item, if it is not already in the selection. .IP [2] Clicking mouse button 1 with the Control key down will reposition the active cursor and add the item to the selection without ever removing any items from the selection. .IP [3] If the mouse is dragged out of the widget while button 1 is pressed, the treectrl will automatically scroll to make more items visible (if there are more items off-screen on the side where the mouse left the window). .IP [4] The Left and Right keys move the active cursor one item to the left or right; for an hierarchical tree with vertical orientation nothing will happen, since it has no two items in the same row. The selection is set to include only the active item. If Left or Right is typed with the Shift key down, then the active cursor moves and the selection is extended to include the new item. .IP [5] The Up and Down keys move the active cursor one item up or down. The selection is set to include only the active item. If Up or Down is typed with the Shift key down, then the active cursor moves and the selection is extended to include the new item. .IP [6] The Next and Prior keys move the active cursor forward or backwards by one screenful, without affecting the selection. .IP [7] Control-Next and Control-Prior scroll the view right or left by one page without moving the active cursor or affecting the selection. Control-Left and Control-Right behave the same. .IP [8] The Home and End keys scroll to the left or right end of the widget without moving the active cursor or affecting the selection. .IP [9] The Control-Home and Control-End keys scroll to the top or bottom of the widget, they also activate and select the first or last item. If also the Shift key is down, then the active cursor moves and the selection is extended to include the new item. .IP [10] The Space and Select keys set the selection to the active item. .IP [11] Control-/ selects the entire contents of the widget. .IP [12] Control-\\\\ clears any selection in the widget. .IP [13] The + and - keys expand or collapse the active item, the Return key toggles the active item. .IP [14] The mousewheel scrolls the view of the widget four lines up or down depending on the direction, the wheel was turned. The active cursor or the selection is not affected. .SH "EXAMPLES" Get the unique identifier for the leftmost visible column: .nf set id [$T column index "first visible"] .fi Delete the leftmost column: .nf $T column delete "order 0" .fi Take the visible column that is to the left of the last column, and move that column in front of the tail column: .nf $T column move "last prev visible" tail .fi Get the unique identifier for the first visible item: .nf set id [$T item index "first visible"] .fi Delete the parent of the item that is under the point x,y: .nf $T item delete "nearest $x $y parent" .fi Add the 10th child of the second child of the root item to the selection: .nf $T selection add "root firstchild nextsibling child 10" .fi Move a column that the user drag-and-dropped: .nf $T column dragconfigure -enable yes $T notify install $T notify bind MyTag { %T column move %C %b } .fi .SH "SEE ALSO" bind(n), bitmap(n), image(n), listbox(n), options(n) .SH "KEYWORDS" tree, widget