Re: [gtk-list] option menu truncation



Matthew D Allen wrote:

> It seems that when an option menu (gtk_option_menu_new()) isn't in what it
> considers to be the right situation, it truncates itself so you can't see
> the text that you've chosen or what is possiible - it shrinks down to a
> simple button with a small box on it showing you that it is still an
> option menu - is there any way to inhibit that?
>
> I think I have enough space in the window to display the longest string
> that it holds, and even if I don't, truncating within the window is ok,
> but not truncating it down to a simple box where no text shows at all.
>
> Does anybody have any suggestions as to how to nix that behavior?

There was a similar thread on gtk-app-devel-list@redhat.com today that I
instigated. Your problem may be different, but it sounds similar.

There's a misfeature or bug in option menus such that they only calculate
their preferred size when the menu is added. If you call
gtk_option_menu_set_menu() with an empty menu, and later add menu items, the
option menu won't automatically adjust its size to account for the length of
the longest menu item as it should. This could end up with a minimally-sized
option menu in a situation where the size isn't dependent on sibling widgets.

I don't know if this would cause no text at all to appear. If you don't call
gtk_option_menu_set_history() on a new option menu, it won't display any text
until the user selects an item. This might be why no text shows at all in your
case.

John Sullivan



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