Re: [gtk-list] Changing a GtkOptionMenu in mid-stream




Jon Trowbridge <trow@emccta.com> writes:

> I've tried to dynamically change a GtkOptionMenu, but without success.
> 
> After initially constructing the widget (and having it work fine), I:
> 
> 1. gtk_option_menu_remove_menu(foo);
> 2. menu = gtk_menu_new();
> 3. create a bunch of gtk_menu_item_new_with_label()s and
>       gtk_menu_append() them to menu
> 4. gtk_option_menu_set_menu(foo, menu)
> 
> The results is an option menu that displays the first menu item in the
> "option box".  However, clicking on the little button doesn't pop up
> the other choices --- it blanks the box, and displays a funny little
> mark in the box's far left side.

Are you remembering to show the menu items as you create them?
The funny little mark is probably a really small window.

> Even worse, trying to pop up the menu has also, randomly:
> * Caused my window manager to segfault

Not our fault :-) Send John Harper a test case.

> * Produced the Gtk-Warning 
>   gtk_widget_size_allocate(): attempted to allocate widget with with
>   65527 and height 1 after hanging X for ~5 seconds.

Hmmm, the wrapped allocation is probably a symptom of a missing
check for a negative value somewhere, but hopefully showing
the items will fix that by giving the window a better size.
 
Regards,
                                        Owen



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