Hi.

> I followed that link but it doesn't look as if it would work for a button.  
> I'd need to be able to get the button's label object (if there is one) but I 
> can't see an obvious way of getting it....  :-(

How you'll get your hands on GtkLabel object inside button depends on
how your button has been constructed. The safest and simplest way of
doing this would be to manually add label to your button using code
like this:

/* *** CODE ***
button = gtk_button_new ();
label = gtk_label_new ("Label");
gtk_container_add (GTK_CONTAINER (button), label);
/* *** end CODE ***

If this approach is not right for your situation, you'll need to walk
the widget hierarchy in the button until you find your label.
Hierarchies as produced by different constructors are (I'm almost
certainly wrong here, but I'm sure someone will correct me):

gtk_button_new_with_label(): button->label
gtk_button_new_from_stock(): button->hbox->label
                                         `>image

Exact widget tree doesn't really matter, since it's relatively easy to
create code that recursively checks for GtkLabel.

Hope this helps a bit.

Tadej
-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeb...@gmail.com
tadej.borov...@gmail.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to