summaryrefslogtreecommitdiffstats
path: root/doc/ttk_treeview.n
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-11-01 16:37:09 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-11-01 16:37:09 (GMT)
commit0241933d2fcf1a09145b33048c52e40988a8bfa9 (patch)
treecee00028b46ebd747b575cdf9398299f2c8393c8 /doc/ttk_treeview.n
parent08a5977be6d47dbe4b3fa1bac892353f66dd2990 (diff)
downloadtk-0241933d2fcf1a09145b33048c52e40988a8bfa9.zip
tk-0241933d2fcf1a09145b33048c52e40988a8bfa9.tar.gz
tk-0241933d2fcf1a09145b33048c52e40988a8bfa9.tar.bz2
merge updates from HEAD
Diffstat (limited to 'doc/ttk_treeview.n')
-rw-r--r--doc/ttk_treeview.n154
1 files changed, 81 insertions, 73 deletions
diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n
index e31199c..be324a4 100644
--- a/doc/ttk_treeview.n
+++ b/doc/ttk_treeview.n
@@ -4,17 +4,15 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_treeview.n,v 1.5.2.2 2007/10/27 04:23:15 dgp Exp $
+'\" RCS: @(#) $Id: ttk_treeview.n,v 1.5.2.3 2007/11/01 16:37:16 dgp Exp $
'\"
.so man.macros
-.TH ttk_treeview n 8.5 Tk "Tk Themed Widget"
-.\" Use _ instead of :: as the name becomes a filename on install
+.TH ttk::treeview n 8.5 Tk "Tk Themed Widget"
.SH NAME
-ttk_treeview \- hierarchical multicolumn data display widget
+ttk::treeview \- hierarchical multicolumn data display widget
.SH SYNOPSIS
\fBttk::treeview\fR \fIpathname \fR?\fIoptions\fR?
.BE
-
.SH DESCRIPTION
The \fBttk::treeview\fR widget displays a hierarchical collection of items.
Each item has a textual label, an optional image,
@@ -23,10 +21,10 @@ The data values are displayed in successive columns after
the tree label.
.PP
The order in which data values are displayed may be controlled
-by setting the \fB-displaycolumns\fR widget option.
+by setting the \fB\-displaycolumns\fR widget option.
The tree widget can also display column headings.
Columns may be accessed by number or by symbolic names
-listed in the \fB-columns\fR widget option;
+listed in the \fB\-columns\fR widget option;
see \fBCOLUMN IDENTIFIERS\fR.
.PP
Each item is identified by a unique name.
@@ -42,13 +40,12 @@ and control the appearance of the item.
.\" @@@HERE: describe selection, focus item
.PP
Treeview widgets support horizontal and vertical scrolling with the
-standard \fB-[xy]scrollcommand\fR options
-and \fB[xyview\fR widget commands.
+standard \fB\-\fR[\fBxy\fR]\fBscrollcommand\fR options
+and [\fBxy\fR]\fBview\fR widget commands.
.SO
\-class \-cursor \-takefocus \-style
\-xscrollcommand \-yscrollcommand
.SE
-
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-columns columns Columns
A list of column identifiers,
@@ -60,8 +57,11 @@ A list of column identifiers
specifying which data columns are displayed
and the order in which they appear,
or the string \fB#all\fP.
-.br
-If set to \fB#all\fP (the default), all columns are shown in the order given.
+.RS
+.PP
+If set to \fB#all\fP (the default), all columns are shown in the order
+given.
+.RE
.OP \-height height Height
Specifies the number of rows which should be visible.
Note:
@@ -73,13 +73,15 @@ see \fBTtk_GetPaddingFromObj()\fR for details.
.OP \-selectmode selectMode SelectMode
Controls how the built-in class bindings manage the selection.
One of \fBextended\fR, \fBbrowse\fR, or \fBnone\fR.
-.br
+.RS
+.PP
If set to \fBextended\fR (the default), multiple items may be selected.
If \fBbrowse\fR, only a single item will be selected at a time.
If \fBnone\fR, the selection will not be changed.
-.br
+.PP
Note that application code and tag bindings can set the selection
-however they wish, regardless of the value of \fB-selectmode\fR.
+however they wish, regardless of the value of \fB\-selectmode\fR.
+.RE
.OP \-show show Show
A list containing zero or more of the following values, specifying
which elements of the tree to display.
@@ -92,9 +94,8 @@ Display the heading row.
The default is \fBtree headings\fR, i.e., show all elements.
.PP
\fBNOTE:\fR Column #0 always refers to the tree column,
-even if \fB-show tree\fR is not specified.
+even if \fB\-show tree\fR is not specified.
.RE
-
.SH "WIDGET COMMAND"
.TP
\fIpathname \fBbbox\fR \fIitem\fR ?\fIcolumn\fR?
@@ -107,51 +108,54 @@ If the \fIitem\fR is not visible
returns the empty list.
.TP
\fIpathname \fBcget\fR \fIoption\fR
-Returns the current value of the specified \fIoption\fR; see \fIttk_widget(n)\fR.
+Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR.
.TP
\fIpathname \fBchildren\fR \fIitem\fR ?\fInewchildren\fR?
If \fInewchildren\fR is not specified,
returns the list of children belonging to \fIitem\fR.
-.br
+.RS
+.PP
If \fInewchildren\fR is specified, replaces \fIitem\fR's child list
with \fInewchildren\fR.
Items in the old child list not present in the new child list
are detached from the tree.
None of the items in \fInewchildren\fR may be an ancestor
of \fIitem\fR.
+.RE
.TP
-\fIpathname \fBcolumn\fR \fIcolumn\fR ?\fI-option \fR?\fIvalue -option value...\fR?
+\fIpathname \fBcolumn\fR \fIcolumn\fR ?\fI\-option \fR?\fIvalue \-option value...\fR?
Query or modify the options for the specified \fIcolumn\fR.
-If no \fI-option\fR is specified,
+If no \fI\-option\fR is specified,
returns a dictionary of option/value pairs.
-If a single \fI-option\fR is specified,
+If a single \fI\-option\fR is specified,
returns the value of that option.
Otherwise, the options are updated with the specified values.
The following options may be set on each column:
.RS
.TP
-\fB-id \fIname\fR
+\fB\-id \fIname\fR
The column name. This is a read-only option.
-For example, [\fI$pathname \fBcolumn #\fIn \fB-id\fR]
+For example,
+.QW \fI$pathname \fBcolumn #\fIn \fB\-id\fR]
returns the data column associated with data column #\fIn\fR.
.TP
-\fB-anchor\fR
+\fB\-anchor\fR
Specifies how the text in this column should be aligned
with respect to the cell. One of
\fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR,
\fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR.
.TP
-\fB-minwidth\fR
+\fB\-minwidth\fR
The minimum width of the column in pixels.
The treeview widget will not make the column any smaller than
-\fB-minwidth\fR when the widget is resized or the user drags a
+\fB\-minwidth\fR when the widget is resized or the user drags a
column separator.
.TP
-\fB-stretch\fR
+\fB\-stretch\fR
Specifies whether or not the column's width should be adjusted
when the widget is resized.
.TP
-\fB-width \fIw\fR
+\fB\-width \fIw\fR
The width of the column in pixels. Default is something reasonable,
probably 200 or so.
.PP
@@ -159,7 +163,7 @@ Use \fIpathname column #0\fR to configure the tree column.
.RE
.TP
\fIpathname \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Modify or query widget options; see \fIttk_widget(n)\fR.
+Modify or query widget options; see \fIttk::widget(n)\fR.
.TP
\fIpathname \fBdelete\fR \fIitemList\fR
Deletes each of the items in \fIitemList\fR and all of their descendants.
@@ -183,22 +187,22 @@ If \fIitem\fR is specified, sets the focus item to \fIitem\fR.
Otherwise, returns the current focus item, or \fB{}\fR if there is none.
.\" Need: way to clear the focus item. {} works for this...
.TP
-\fIpathname \fBheading\fR \fIcolumn\fR ?\fI-option \fR?\fIvalue -option value...\fR?
+\fIpathname \fBheading\fR \fIcolumn\fR ?\fI\-option \fR?\fIvalue \-option value...\fR?
Query or modify the heading options for the specified \fIcolumn\fR.
Valid options are:
.RS
.TP
-\fB-text \fItext\fR
+\fB\-text \fItext\fR
The text to display in the column heading.
.TP
-\fB-image \fIimageName\fR
+\fB\-image \fIimageName\fR
Specifies an image to display to the right of the column heading.
.TP
-\fB-anchor \fIanchor\fR
+\fB\-anchor \fIanchor\fR
Specifies how the heading text should be aligned.
One of the standard Tk anchor values.
.TP
-\fB-command \fIscript\fR
+\fB\-command \fIscript\fR
A script to evaluate when the heading label is pressed.
.PP
Use \fIpathname heading #0\fR to configure the tree column heading.
@@ -225,7 +229,7 @@ and data columns.
\fIpathname \fBindex \fIitem\fR
Returns the integer index of \fIitem\fR within its parent's list of children.
.TP
-\fIpathname \fBinsert\fR \fIparent\fR \fIindex\fR ?\fB-id \fIid\fR? \fIoptions...\fR
+\fIpathname \fBinsert\fR \fIparent\fR \fIindex\fR ?\fB\-id \fIid\fR? \fIoptions...\fR
Creates a new item.
\fIparent\fR is the item ID of the parent item,
or the empty string \fB{}\fR
@@ -236,22 +240,24 @@ If \fIindex\fR is less than or equal to zero,
the new node is inserted at the beginning;
if \fIindex\fR is greater than or equal to the current number of children,
it is inserted at the end.
-If \fB-id\fR is specified, it is used as the item identifier;
+If \fB\-id\fR is specified, it is used as the item identifier;
\fIid\fR must not already exist in the tree.
Otherwise, a new unique identifier is generated.
-.br
+.RS
+.PP
\fIpathname \fBinsert\fR returns the item identifier of the
newly created item.
See \fBITEM OPTIONS\fR for the list of available options.
+.RE
.TP
\fIpathname \fBinstate \fIstatespec\fR ?\fIscript\fR?
-Test the widget state; see \fIttk_widget(n)\fR.
+Test the widget state; see \fIttk::widget(n)\fR.
.TP
-\fIpathname \fBitem\fR \fIitem\fR ?\fI-option \fR?\fIvalue -option value...\fR?
+\fIpathname \fBitem\fR \fIitem\fR ?\fI\-option \fR?\fIvalue \-option value...\fR?
Query or modify the options for the specified \fIitem\fR.
-If no \fI-option\fR is specified,
+If no \fI\-option\fR is specified,
returns a dictionary of option/value pairs.
-If a single \fI-option\fR is specified,
+If a single \fI\-option\fR is specified,
returns the value of that option.
Otherwise, the item's options are updated with the specified values.
See \fBITEM OPTIONS\fR for the list of available options.
@@ -259,10 +265,12 @@ See \fBITEM OPTIONS\fR for the list of available options.
\fIpathname \fBmove \fIitem parent index\fR
Moves \fIitem\fR to position \fIindex\fR in \fIparent\fR's list of children.
It is illegal to move an item under one of its descendants.
-.br
+.RS
+.PP
If \fIindex\fR is less than or equal to zero, \fIitem\fR is moved
to the beginning; if greater than or equal to the number of children,
-it's moved to the end.
+it is moved to the end.
+.RE
.TP
\fIpathname \fBnext \fIitem\fR
Returns the identifier of \fIitem\fR's next sibling,
@@ -278,7 +286,7 @@ or \fB{}\fR if \fIitem\fR is the first child of its parent.
.TP
\fIpathname \fBsee\fR \fIitem\fR
Ensure that \fIitem\fR is visible:
-sets all of \fIitem\fR's ancestors to \fB-open true\fR,
+sets all of \fIitem\fR's ancestors to \fB\-open true\fR,
and scrolls the widget if necessary so that \fIitem\fR is
within the visible portion of the tree.
.TP
@@ -300,7 +308,7 @@ Remove \fIitemList\fR from the selection
Toggle the selection state of each item in \fIitemList\fR.
.RE
.TP
-\fIpathname \fBset\fR \fIitem\fR ?\fIcolumn\fR ?\fIvalue\fR??
+\fIpathname \fBset\fR \fIitem\fR ?\fIcolumn\fR? ?\fIvalue\fR?
With one argument, returns a dictionary of column/value pairs
for the specified \fIitem\fR.
With two arguments, returns the current value of the specified \fIcolumn\fR.
@@ -309,25 +317,27 @@ in item \fIitem\fR to the specified \fIvalue\fR.
See also \fBCOLUMN IDENTIFIERS\fR.
.TP
\fIpathname \fBstate\fR ?\fIstateSpec\fR?
-Modify or query the widget state; see \fIttk_widget(n)\fR.
+Modify or query the widget state; see \fIttk::widget(n)\fR.
.TP
\fIpathName \fBtag \fIargs...\fR
.RS
.TP
-\fIpathName \fBtag bind \fItagName \fR?\fIsequence \fR?\fIscript\fR??
+\fIpathName \fBtag bind \fItagName \fR?\fIsequence\fR? ?\fIscript\fR?
Add a Tk binding script for the event sequence \fIsequence\fR
to the tag \fItagName\fR. When an X event is delivered to an item,
-binding scripts for each of the item's \fB-tags\fR are evaluated
+binding scripts for each of the item's \fB\-tags\fR are evaluated
in order as per \fIbindtags(n)\fR.
-.br
+.RS
+.PP
\fB<KeyPress>\fR, \fB<KeyRelease>\fR, and virtual events
are sent to the focus item.
\fB<ButtonPress>\fR, \fB<ButtonRelease>\fR, and \fB<Motion>\fR events
are sent to the item under the mouse pointer.
No other event types are supported.
-.br
+.PP
The binding \fIscript\fR undergoes \fB%\fR-substitutions before
evaluation; see \fBbind(n)\fR for details.
+.RE
.TP
\fIpathName \fBtag configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
Query or modify the options for the specified \fItagName\fR.
@@ -345,9 +355,7 @@ See \fBTAG OPTIONS\fR for the list of available options.
Standard command for horizontal scrolling; see \fIwidget(n)\fR.
.TP
\fIpathName \fByview \fIargs\fR
-Standard command for vertical scrolling; see \fIttk_widget(n)\fR.
-
-.PP
+Standard command for vertical scrolling; see \fIttk::widget(n)\fR.
.SH "ITEM OPTIONS"
The following item options may be specified for items
in the \fBinsert\fR and \fBitem\fR widget commands.
@@ -357,38 +365,39 @@ The textual label to display for the item.
A Tk image, displayed to the left of the label.
.OP \-values values Values
The list of values associated with the item.
-.br
+.RS
+.PP
Each item should have the same number of values as
-the \fB-columns\fR widget option.
+the \fB\-columns\fR widget option.
If there are fewer values than columns,
the remaining values are assumed empty.
If there are more values than columns,
the extra values are ignored.
+.RE
.OP \-open open Open
A boolean value indicating whether the item's children
-should be displayed (\fB-open true\fR) or hidden (\fB-open false\fR).
+should be displayed (\fB\-open true\fR) or hidden (\fB\-open false\fR).
.OP \-tags tags Tags
A list of tags associated with this item.
.SH "TAG OPTIONS"
The following options may be specified on tags:
-.IP \-foreground
+.IP \fB\-foreground\fR
Specifies the text foreground color.
-.IP \-background
+.IP \fB\-background\fR
Specifies the cell or item background color.
-.IP \-font
+.IP \fB\-font\fR
Specifies the font to use when drawing text.
.\" ??? Maybe: .IP \-anchor
.\" ??? Maybe: .IP \-padding
.\" ??? Maybe: .IP \-text
-.IP \-image
-Specifies the item image, in case the item's \fB-image\fR option is empty.
+.IP \fB\-image\fR
+Specifies the item image, in case the item's \fB\-image\fR option is empty.
.PP
\fI(@@@ TODO: sort out order of precedence for options)\fR
-
.SH "COLUMN IDENTIFIERS"
Column identifiers take any of the following forms:
.IP \(bu
-A symbolic name from the list of \fB-columns\fR.
+A symbolic name from the list of \fB\-columns\fR.
.IP \(bu
An integer \fIn\fR, specifying the \fIn\fRth data column.
.IP \(bu
@@ -396,17 +405,17 @@ A string of the form \fB#\fIn\fR, where \fIn\fR is an integer,
specifying the \fIn\fRth display column.
.PP
\fBNOTE:\fR
-Item \fB-values\fR may be displayed in a different order than
+Item \fB\-values\fR may be displayed in a different order than
the order in which they are stored.
.PP
\fBNOTE:\fR Column #0 always refers to the tree column,
-even if \fB-show tree\fR is not specified.
+even if \fB\-show tree\fR is not specified.
.PP
-A \fIdata column number\fR is an index into an item's \fB-values\fR list;
+A \fIdata column number\fR is an index into an item's \fB\-values\fR list;
a \fIdisplay column number\fR is the column number in the tree
where the values are displayed.
Tree labels are displayed in column #0.
-If \fB-displaycolumns\fR is not set,
+If \fB\-displaycolumns\fR is not set,
then data column \fIn\fR is displayed in display column \fB#\fIn+1\fR.
Again, \fBcolumn #0 always refers to the tree column\fR.
.SH "VIRTUAL EVENTS"
@@ -414,14 +423,13 @@ The treeview widget generates the following virtual events.
.IP <<TreeviewSelect>>
Generated whenever the selection changes.
.IP <<TreeviewOpen>>
-Generated just before setting the focus item to \fB-open true\fR.
+Generated just before setting the focus item to \fB\-open true\fR.
.IP <<TreeviewClose>>
-Generated just after setting the focus item to \fB-open false\fR.
+Generated just after setting the focus item to \fB\-open false\fR.
.PP
The \fBfocus\fR and \fBselection\fR widget commands can be used
to determine the affected item or items.
-In Tk 8.5, the affected item is also passed as the \fB-detail\fR field
+In Tk 8.5, the affected item is also passed as the \fB\-detail\fR field
of the virtual event.
-
.SH "SEE ALSO"
-ttk_widget(n), listbox(n), image(n), bind(n)
+ttk::widget(n), listbox(n), image(n), bind(n)