Re: Another Option menu question



Colin Thomas wrote:
> Hi,
>
> Thanks for all the responses on my 1st option menu question : I now have
> another. ;-)
>
>
> I am implementing a "reset" button on my app, and need to force all
> entries et al to a default values.
>
> My option menu has 4 choices in it.
>
> If I have a combo, I can use the gtk_entry_set_text to force a new
> value: this route does not extend to Option menus though ;-(
>
> How can I obtain the 1st defined element in the choice list for an
> option menu, and then reset it to be that value ?
>
> I look forward again to your collective wisdom..
>
> best regards
>
> /colin.
>

for gtk+ 1.2, you can listen to the "changed" signal on the menu and
store the currently selected item inside that callback.  to reset the
menu, use gtk_option_menu_set_history with the original value.  when you
upgrade to 2.x, you can just use gtk_option_menu_get_history to get the
current value, and set_history to change it.

todd







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