[9124] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Modifying the text of a single item in a menu.
daemon@ATHENA.MIT.EDU (Dave Cole)
Fri Oct 9 10:26:21 1998
To: gtk-list@redhat.com
From: Dave Cole <dave@dccs.com.au>
Date: 10 Oct 1998 00:25:51 +1000
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
I have spent the last few hours trying to work out how to modify the
text of an item in a menu. I have as yet been unsuccessful.
All of the items in the menu were created with gtk_menu_item_new_with_label()
The code I am using to traverse and update the menu looks like:
for (list = GTK_MENU_SHELL(menu)->children; list != NULL;
list = list->next) {
GtkBin* bin = GTK_BIN(list->data);
if (bin->child != NULL) {
char* text;
gtk_label_get(GTK_LABEL(bin->child), &text);
if (strcmp(text, current) == 0) {
gtk_label_set(GTK_LABEL(bin->child), new);
break;
}
}
}
For some reason which I cannot understand, the bin never has a
non-null child in it. I am obviously missing something here, I just
cannot work out what it is.
- Dave
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS dpu s-:+ a C++$ ULS++$ P+++$>++++ L++>+++$ E+>++ W N++ !o K w++$ O !M-
!V(-) PS+ PE- Y+ PGP !t-- 5++ X R tv b+ DI+++ D G e++ h--- r+++ y++++
------END GEEK CODE BLOCK------
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null