ttk treeview widget: how to tell if an item is detached
- From: Zhang Weiwu <zhangweiwu+Junk@xxxxxxxxxx>
- Date: Mon, 07 Jun 2010 16:10:40 +0800
Is there a way to tell if an item is detached? For use of detach:
manual of ttk::treeview(3tk)
pathname detach itemList
Unlinks all of the specified items in itemList from the tree.
The items and all of their descendants are still present and may
be reinserted at another point in the tree but will not be dis‐
played. The root item may not be detached. See also: delete.
I first tried
$treeview exists item
and found it returns true for both detached items and regular items.
Then I tried
$treeview parent item
Realized detached item always returns empty string {}, but then, regular
items who are direct children of root item also returns empty string,
thus not distinguished.
Then I tried
$treeview index item
hoping detached item returns some special value. It returns zero. But
since index start from zero, the first children item also returns zero,
thus not distinguished.
Of course I tried to google and look up tcl.tk wiki pages before all
these studies. So it seems I did pretty much home work and had to left
this to the wisdom of usenet.
As a last resort, I can always keep a variable to hold list of detached
items the moment I detach them, but then it's not very good programming,
because then the program who uses the widget knows a bit too much how
the widget works.
Thanks in advance!
.
- Follow-Ups:
- Re: ttk treeview widget: how to tell if an item is detached
- From: Joe English
- Re: ttk treeview widget: how to tell if an item is detached
- Prev by Date: ANNOUNCE: Plotchart 1.8.3
- Next by Date: Re: Parser generator (+ Lexer) that actually works?
- Previous by thread: ANNOUNCE: Plotchart 1.8.3
- Next by thread: Re: ttk treeview widget: how to tell if an item is detached
- Index(es):
Relevant Pages
|