Re: dynamic menus
- From: "Karl H. Beckers" <karl h beckers gmx net>
- To: "David Necas (Yeti)" <yeti physics muni cz>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: dynamic menus
- Date: Tue, 13 Jul 2004 09:06:39 +0200
David Necas (Yeti) schrieb:
[...]
First, you know the index. The entries are simply
sequentially numbered from 0, so if you constructed them
you also know the index.
Well, yes ... that's what I meant ... I don't know it because I didn't
store it ;)
Then, there's sometimes the possbility you don't have the
original map from/to indices available any more. You can
obtain the list of items:
GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(option_menu));
GList *list = GTK_MENU_SHELL(menu)->children;
and scan the list. It's usually a better idea to identifiy
the items explicitely with some g_object_set_[q]data(...) at
the time of construction and checking these instead of the
labels.
Thanks for those hints. I'll try that path.
Karl.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]