ttk::treeview heading
Gives or sets the options of the heading of a column.
PATHNAME heading COLUMN
PATHNAME heading COLUMN OPTION
PATHNAME heading COLUMN OPTION VALUE ?OPTION VALUE ...?
Description
With no OPTION, gives a list of each heading option and its value. With one OPTION, gives its value. With pairs, sets the options. The heading options are these.
-text: the text of the heading.-image: an image of the heading.-anchor: the place of the text in the heading.-command: a script that runs at the global level when the user clicks the heading, such as to sort the rows.
Returns
A list of options and values, a value, or an empty string.
Examples
% ttk::treeview .ttvhd -columns {size}
> .ttvhd heading size -text Size
> .ttvhd heading size -text
Size
% ttk::treeview .ttvhd2
> .ttvhd2 heading #0 -text Name -command {set ::ttvsorted 1}
> pack .ttvhd2
> update
> event generate .ttvhd2 <Button-1> -x 5 -y 5
> event generate .ttvhd2 <ButtonRelease-1> -x 5 -y 5
> update
> set ::ttvsorted
1
Errors
% ttk::treeview .ttvhd3 -columns {a}; .ttvhd3 heading a -anchor bogus
bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1