1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 a widget used to choose from a list of valid choices.
7 <!-- ##### SECTION Long_Description ##### -->
9 A #GtkOptionMenu is a widget that allows the user to choose from a
10 list of valid choices. The #GtkOptionMenu displays the selected
11 choice. When activated the #GtkOptionMenu displays a popup #GtkMenu
12 which allows the user to make a new choice.
16 Using a #GtkOptionMenu is simple; build a #GtkMenu, by calling
17 gtk_menu_new(), then appending menu items to it with
18 gtk_menu_shell_append(). Set that menu on the option menu
19 with gtk_option_menu_set_menu(). Set the selected menu item with
20 gtk_option_menu_set_history(); connect to the "changed" signal on
21 the option menu; in the "changed" signal, check the new selected
22 menu item with gtk_option_menu_get_history().
25 <!-- ##### SECTION See_Also ##### -->
28 <!-- ##### STRUCT GtkOptionMenu ##### -->
30 The #GtkOptionMenu-struct struct contains private data only, and
31 should be accessed using the functions below.
35 <!-- ##### FUNCTION gtk_option_menu_new ##### -->
37 Creates a new #GtkOptionMenu.
40 @Returns: a new #GtkOptionMenu.
43 <!-- ##### FUNCTION gtk_option_menu_get_menu ##### -->
45 Returns the #GtkMenu associated with the #GtkOptionMenu.
48 @option_menu: a #GtkOptionMenu.
49 @Returns: the #GtkMenu associated with the #GtkOptionMenu.
52 <!-- ##### FUNCTION gtk_option_menu_set_menu ##### -->
54 Provides the #GtkMenu that is popped up to allow the user to choose
55 a new value. You should provide a simple menu avoiding the
56 use of tearoff menu items, submenus, and accelerators.
59 @option_menu: a #GtkOptionMenu.
60 @menu: the #GtkMenu to associate with the #GtkOptionMenu.
63 <!-- ##### FUNCTION gtk_option_menu_remove_menu ##### -->
65 Removes the menu from the option menu.
68 @option_menu: a #GtkOptionMenu.
71 <!-- ##### FUNCTION gtk_option_menu_set_history ##### -->
73 Selects the menu item specified by @index making it the newly
74 selected value for the option menu.
77 @option_menu: a #GtkOptionMenu.
78 @index: the index of the menu item to select. Index values are from
82 <!-- ##### FUNCTION gtk_option_menu_get_history ##### -->
91 <!-- ##### SIGNAL GtkOptionMenu::changed ##### -->
96 @optionmenu: the object which received the signal.
98 <!-- ##### ARG GtkOptionMenu:menu ##### -->