Re: query ttk::treeview for all nodes?



On Apr 30, 1:06 pm, Aric Bills <aric.bi...@xxxxxxxxx> wrote:
On Apr 30, 6:05 am, Clint <ckhan...@xxxxxxxxx> wrote:

Using Tcl 8.5.2 and tile 0.8.2:

I am trying to find the best way to query the tree for the all current
nodes in the tree so that I can easily delete everything in the tree.
I have played with keeping a list or an array around when I build the
tree to use that, but gets a little challenging when adding or
deleting a node or two from a large tree.

I have used the Bwidget tree in the past and could get all nodes (and
delete) by a command like:

-> $tree delete [ $tree nodes root ]

The Tile equivalent is:

$treeview delete [$treeview children {}]

My guess is that the treeview builds nodes that are a sibling to the
root node and not a child?

No, they are descendants of the root node, which is {}.

Hope that helps,
Aric

Ah, that is it. I kept wanting to use the id of 'root' instead of
{}. Thanks!
.



Relevant Pages

  • Re: Binqry Tree sort
    ... In addition we have a network as a parallel ... But the processors which I want to use in my bianry tree architecture ... The root node has no bottle neck becasue it just receives data from its ...
    (comp.programming)
  • Re: to merge two binary tree
    ... node has to be taken as root node in the new tree ...etc ... Surely there must be an algorithm in Knuth. ... The root node of the merge will in general ... to a usual binary-tree insertion algorithm. ...
    (comp.lang.c.moderated)
  • RE: Newbie: Trouble accessing all nodes in a tree view
    ... My tree has a single root node named ... > a new node at a deep level on the tree. ... > listed in the collection is the root node Clients. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: How to retrieve the pointer to leaf node of a Binary tree
    ... Now, just to observe, there is no 'the' leaf node; both e and c are leaf nodes. ... left-to right arithmetic expression tree walk is an LRN walk. ... The GetLeafNode method given above returns the pointer to the root node. ...
    (microsoft.public.vc.mfc)
  • Re: Root and leaf node from a hierarchical tree.
    ... Tree strucutres can have any arbitrary depth. ... | Root node has parent_id as null. ... | rootB B-child1 ... | achieve the result by just writing a sql statement. ...
    (comp.databases.oracle.server)