Re: How to change the label of a menuitem in the program?



Hi sunwei,

when you create the manuitem, do like this:

	item = gtk_menu_item_new();
	box = gtk_hbox_new(TRUE, 0);

	gtk_container_add(GTK_CONTAINER(item), box);
	
	label = gtk_label_new("whatever");
	gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
	gtk_widget_show(label);
	gtk_widget_show(box);
	gtk_widget_show(item);

to change the text call
	gtk_label_set_text(GTK_LABEL(label), "something else");

greetings
Karsten

Am Sonntag, 19. Januar 2003 17:10 schrieb sunwei:
> Hello!
>
> I want to change the label of a menu-item in the program. But I do not
> which function can do this. So could you give me some suggestions?
>
> Any reply will be highly appreciated!
>
> sunwei
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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