menuitem and optionmenu don't follow the normal tree manner




hi all,


there is a decent problem with menuitems that have sub_menus set,
and with the optionmenu.
in the current fileselection widget, ian uses the option menu for
the directory history. once you change the directory, the sub menu
of the optionmenu is destroy and he connects a new menu to it.
this is *supposed* to work but doesn't because we don't have the
foreach neither the container_add/container_remove functionality
for option menus.

i talked to peter about this a while ago, and he even wondered why
he hadn't implemented it this way in the first place.

no the specific changes i plan on imlementing are about:
void       gtk_option_menu_add    (GtkOptionMenu *option_menu,
                                   GtkWidget     *menu);
void       gtk_option_menu_remove (GtkOptionMenu *option_menu,
				   GtkWidget	 *child);

this will just work like on normal GtkBin widgets that
are containers which handle a single child.
the menu will be accesseble through the foreach functionality
as well.

now this ruels out the existing functions
void       gtk_option_menu_set_menu    (GtkOptionMenu *option_menu,
                                        GtkWidget     *menu);
void       gtk_option_menu_remove_menu (GtkOptionMenu *option_menu);

but we can at least provide some *temporary* defines wich used
will obviously be discuraged:

#define	gtk_option_menu_set_menu(o,m)	gtk_option_menu_add(o,a)
#define	gtk_option_menu_remove_menu(o)	gtk_option_menu_remove(o,GTK_OPTION_MENU(o)->menu)

now after you got the idea, a menu item will be just the same.

anyone, with a better implementation approach? ;)

---
ciaoTJ



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