Re: [gtk-list] Re: data from tree



On Thu, 23 Jul 1998, Thomas Mailund Jensen wrote:

>  JS> I tried *_get_user_data in callback function but it also doesn't work :-(.
>  JS> Do you have any idea what to do?
> 
> No...this worked for me...unless it's the label text you want to
> extract and not user_data associated with the tree item.
> 
> I don't know how to do that directly in the tree widget.  In ctree you
> would call gtk_ctree_get_text (ctree, node, column, &text).
> 
> If you could get to the label in the tree you could call
> 
>  gtk_label_get (label, &text);
> 
> but I don't know how to get the label from the tree item. Does anyone
> have an idear?  I would also like to know.


assuming you got that tree item `tree_item' and that its lable
is directly packed into it (no hbox or something like that inbetween),
you can get its label from

if (GTK_IS_LABEL (GTK_BIN (tree_item)->child))
  return GTK_LABEL (GTK_BIN (tree_item)->child)->label;
else
  return NULL;

> 
> I don't know if any of this helps...
> 
> /mailund
> 

---
ciaoTJ



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