beetlebug▾
/

ttk::treeview insert

Adds a new item and gives its ID.

PATHNAME insert PARENT INDEX ?-id ID? ?OPTION VALUE ...?

Description

Adds an item as a child of PARENT, {} for the root, before the child at INDEX, a number or end. With -id, the item has that ID, else the tree view makes a new ID such as I001. The other options are the item options of item.

Returns

The ID of the new item.

Examples

% ttk::treeview .ttvin
> .ttvin insert {} end -id a -text A
> .ttvin insert {} 0 -text B
> .ttvin children {}
I001 a

Errors

% ttk::treeview .ttvin2; .ttvin2 insert {} end -id a; .ttvin2 insert {} end -id a
Item a already exists
-errorcode NONE

% ttk::treeview .ttvin3; .ttvin3 insert nosuch end
Item nosuch not found
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also