[prev in list] [next in list] [prev in thread] [next in thread]
List: gtk
Subject: [gtk-list] Re: How to change a label in a GtkTree?
From: Havoc Pennington <rhp () zirx ! pair ! com>
Date: 1999-07-09 14:45:51
[Download RAW message or body]
On Fri, 9 Jul 1999, Quentin Delamarre wrote:
>
> I've got the GtkTreeItem corresponding, created by the function:
> item = gtk_tree_item_new_with_label("Label 2");
>
> And my question is:
>
> how to change the text of the label from the item ?
>
Do gtk_tree_item_new_with_label() by hand, that is, cut-and-paste its
implementation:
GtkWidget*
gtk_tree_item_new_with_label (gchar *label)
{
GtkWidget *tree_item;
GtkWidget *label_widget;
tree_item = gtk_tree_item_new ();
label_widget = gtk_label_new (label);
gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
gtk_container_add (GTK_CONTAINER (tree_item), label_widget);
gtk_widget_show (label_widget);
return tree_item;
}
Then you'll have a pointer to the label widget and you can
gtk_label_set_text().
You could also call gtk_container_children() on the tree item and the
label should be the tree item's only child.
Havoc
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic