Re: [gtk-list] GtkOptionMenu/GtkMenu
- From: John Sullivan <sullivan eazel com>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] GtkOptionMenu/GtkMenu
- Date: Thu, 09 Dec 1999 09:45:08 -0800
I've used gtk_option_menu_set_history() to set the initially-displayed text in
an option menu without a problem. Make sure you call set_menu before you call
set_history, and that you've installed all the menu items in the menu before
you call set_menu.
John
Matthew D Allen wrote:
> I have a menu packed into an option menu. I'd like to set the default
> item to be something other than the first (offset 0). After reading the
> RDP, I found two things - gtk_menu_set_active() and
> gtk_option_menu_set_history().
>
> I've tried several combinations of these, and nothing works correctly -
> the closest I can get is a somewhat quirky behavior when I just use
> gtk_menu_set_active(): when you pull down the menu, then move your
> pointer elsewhere and let the menu disappear without choosing anything,
> then after you let the menu collapse back in, it displays the original
> intended value (even though nothing was selected and initially it
> displayed the 0th entry). All other combinations don't cause that
> behavior and just set the option menu to show the first item.
>
> What I've tried: (Example using the 4th menu item as what I want to
> default to)
>
> Attempt #1:
> gtk_option_menu_set_history(GTK_OPTION_MENU(some_opt_menu), 3);
> gtk_menu_set_active(GTK_MENU(im_in_some_opt_menu), 3);
>
> Attempt #2:
> /* This is the one that causes the weird behavior */
> gtk_menu_set_active(GTK_MENU(im_in_some_opt_menu), 3);
>
> Attempt #3:
> gtk_option_menu_set_history(GTK_OPTION_MENU(some_opt_menu), 3);
>
> Any suggestions? I've been crusing the header files and the RDP for an
> alternative, but there doesn't seem to be one. The RDP does describe
> gtk_option_menu_set_history() as doing what I want it to do though. Is
> there some restriction on whether the widget has to be shown/realized/etc.
> before that will work properly?
>
> Thanks in advance
> David Allen
>
> http://opop.nols.com/ Free Software Development
> ==========================================================================
> Der Horizont vieler Menschen ist ein Kreis mit Radius Null -- und das
> nennen sie ihren Standpunkt.
> ==========================================================================
> perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]