Re: [gtk-list] Re: Bug fix or feature addition?



Lars Hamann wrote:
> 
> On Sat, Aug 28, 1999 at 04:55:41AM -0600, Brad Pepers wrote:
> 
> > Another question (there are always more!) is how to easily change the
> > is_leaf status on a node.  Right now it looks like I've got to call
> > gtk_ctree_get_node_info with a whole wack of pointers to things and
> > then call gtk_ctree_set_node_info with all the same data.  Wouldn't
> > it be nicer and easier just to have some routines to change things
> > like the is_leaf status?
> 
> No, there is no other way to do it. Maybe it would be nicer to have
> such functions, but I think ctree does already have too much...

It does make it a pain when all you want to do is change one thing.
I got around it by making all the nodes be non-leafs on the chance
that even if it was a leaf at the start, it may need to change down
the road.  This didn't seem to have any effect on the ctree at all
which made me wonder what effects declaring a node a leaf or not
should have.  Does it change the bahaviour in some way I haven't
seen yet?

> > Plus I can't seem to get the text part right.
> > I declare a char* variable called text, pass a pointer to this to the
> > get_node_info routine and then pass text itself to set_node_info.
> > Doing this turns the text of the node to garbage so what do I do?  Do
> > I have to regenerate the text for the node just to change the is_leaf
> > status?
> >
> [...]
> 
> > Here is basically the code I have that works for setting the is_leaf
> > but turns the text to garbage:
> 
> It's even a bit more troublesome. The returned text is only a pointer
> to the node text, not a copy. If you try to feed that pointer into
> set_node_info, ctree will free text first and then tries to copy it.
> So you have to generate your own copy of text :

I'm not sure what you mean by the node text.  When I first create the
node
I pass in an array of char* for each of the columns.  So if a ctree has
multiple columns, what is the text I get back from get_node_info?

-- 
Brad Pepers
Linux Canada Inc.            Home of Linux products in Canada!
http://www.linuxcanada.com   Proud supporter of Cyclades, Red
brad@linuxcanada.com         Hat, and Caldera.



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