Re: [gtk-list] GtkCTree.... again



On Wed, Oct 06, 1999 at 05:05:14PM +0000, Andy Connor wrote:

> 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?

Use gtk_ctree_insert_node() and pass the 'parent' argument as NULL. You can
use this to add one or more 'root' nodes to your CTree.

The following code fragment hopefully illustrates what I mean.

gchar *node_label[2]
GtkCTreeNode *root;
GtkCTree *the_tree;

node_label[0] = "Root Node, column 1";
node_label[1] = "Root Node, column 2";

the_tree = gtk_ctree_new(2,1);
root = gtk_ctree_insert_node(GTK_CTREE(the_tree), NULL, NULL,
                             node_label,
			     0, NULL, NULL, NULL, 
			     NULL, FALSE, FALSE);

Where you can substitute any of the other arguments in gtk_ctree_insert_node
for whatever's most appropriate.

Hope that helps,

-- 
Lee.
http://atlas.cs.york.ac.uk/~lrpm100/



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