[gtkada] Ctree Collapse-Expand and resultant node list
Emmanuel Briot
briot at act-europe.fr
Wed Mar 21 10:14:07 CET 2001
> After filling the tree, I assembled a node list using my own list utility.
> I then used this list, instead of the query Gtk.Ctree.Get_Node_List, when
> attempting to determine if each node is viewable. So the fact that the
> Gtk.Ctree.Node_List was dropping nodes, did not mean that the nodes
> themselves were corrupt.
Larisa,
What we use in GVD (Gnu Visual Debugger) is:
declare
Nodes : Row_List.Glist := Get_Row_List (Tree); -- not Get_Node_List
Node : Gtk_Ctree_Node;
begin
Node := Find_Node_Ptr (Tree, Row_List.Get_Data (Nodes));
while Node /= null loop
...;
Node := Row_Get_Sibling (Node_Get_Row (Node));
end loop;
end;
Let us know if this works for you, and we'll add it to the documentation.
> The second problem is still a strange one. Replacing the use of
> Gtk.Ctree.Is_Viewable with the following seems to work:
We don't have this problem in GVD, and we only use a direct call to
Is_Viewable.
if not Is_Viewable (Tree, Node) then
Expand (Tree, Row_Get_Parent (Node_Get_Row (Node)));
end if;
> That wouldn't be all so bad, except that the first time the tree is shown
> (expanded), the Gtk.Ctree.Is_Viewable (rightly) returns true for all
> nodes,instead of a reversal of logic for child nodes. So I had to add a
> "first time" attribute to check (and I must always initialize with the tree
> expanded -- no problem for me, but a limitation).
Again, we do not have this problem, but then we always create the tree not
expanded at first, and it is automatically expanded by the above code when a
node needs to be shown.
This might explain the difference we see, but somehow I doubt it :-)
Emmanuel
More information about the gtkada
mailing list