Content-Type: text/plain; charset="us-ascii" From: Stalkern 2 Reply-To: stalkern2 at tin.it To: lablgtk at kaba.or.jp Subject: Trees, subtrees and tree_items Date: Thu, 23 Jan 2003 21:43:06 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200301232143.06561.stalkern2 at tin.it> Hello to everybody. I'm still working on my tree and looking for some things to be sure about. In particular, I wanted to write a basic function adding a tree_item child to a tree, and a basic function adding a sibling brother to a tree_item. So I've written let add_new_child_element (aCandidateParentTree: GTree.tree) aNewElementLabel = GTree.tree_item ~label:aNewElementLabel ~packing:(aCandidateParentTree #insert ~pos:0) ();; while I can't write a function for adding a sibling element, because I can't understand how to find the parent of the start element. In other implementations of Gtk there is a method "parent" but I can't see it in module GTree... Furthermore, I wonder whether are these statement right: 1) A tree is made of tree_items. 2) The name "subtree" stands for the container of such tree_items. 3) Both subtree and tree_items can be sibling children of either a tree or a subtree. 4) A tree is a orphan subtree. 5) It is NOT possible to turn a tree_item without a subtree in a tree_item with a subtree, but it is possible to turn a tree_item into a subtree and viceversa 6) A newly created subtree does NOT require to be filled with a child Actually I think that I'm confusing the Gtk tree structure with the filesystem one, and I tend to see a tree as the Root / and subtrees as dirs. Am I right in doing so? Any hint would be appreciated. TIA Ernesto PS I'm thinking that I came by chance to a programming place where only the braves go.