GtkCTree.... again



Thanks to those who pointed me to some source code that used GtkCTree.
Mostly a bit complicated for what I currently want to do and I've found
it a bit tricky to work out exactly what is going on and could do with a
bit more help.

What I want to do is use GtkCTree to create an expandable tree structure
that has pixmaps that correspond to certain nodes in the tree.

If I create using;

ctree = gtk_ctree_new(2,1);

to create a a two columned tree, how do you then add nodes to the tree?

I've looked at the header file, and the most appropriate function seems
to be gtk_ctree_insert_node(). The prototype for this is;

GtkCTreeNode * gtk_ctree_insert_node             (GtkCTree     *ctree,
                                                  GtkCTreeNode *parent, 
                                                  GtkCTreeNode *sibling,
                                                  gchar        *text[],
                                                  guint8        spacing,
                                                  GdkPixmap   
*pixmap_closed,
                                                  GdkBitmap   
*mask_closed,
                                                  GdkPixmap   
*pixmap_opened,
                                                  GdkBitmap   
*mask_opened,
                                                  gboolean      is_leaf,
                                                  gboolean     
expanded);

How can this function be used to insert a root node and a number of
child nodes? Or should I use the gtk_ctree_insert_gnode() function to
insert a node that has been previously defined using a gtree/gnode
structure?

Many thanks in advance,


Andy


-- 
Andy Connor
Research Associate, Cambridge Engineering Design Centre
http://www.cus.cam.ac.uk/~amc50/home.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]