Re: Set text on GtkImageMenuItem



On Tue, 2007-01-30 at 14:47 -0200, Felipe Weckx wrote:
> I create a GtkImageMenuItem with gtk_image_menu_item_new_with_label and
> then add the image later. The problem is: I have to change the text and
> image during execution time, the image is easily changeable with
> gtk_image_menu_item_set_image, but I don't see anything similar to
> change the text on the label. Is it possible or I've to create a new
> GtkImageMenuItem and replace the old one?

Use GtkAction.  Create the GtkImageMenuItem from a GtkAction with
gtk_action_create_menu_item() and then set the "label" property on the
GtkAction.

Of course, you probably shouldn't be doing that at all; it's bad UI to
change element labels.

Ed




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