]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkoptionmenu.sgml
More precise documentation about underscores and mnemonics. (#66380)
[~andy/gtk] / docs / reference / gtk / tmpl / gtkoptionmenu.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkOptionMenu
3
4 <!-- ##### SECTION Short_Description ##### -->
5 a widget used to choose from a list of valid choices.
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
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.
13 </para>
14
15 <para>
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().
23 </para>
24
25 <!-- ##### SECTION See_Also ##### -->
26
27
28 <!-- ##### STRUCT GtkOptionMenu ##### -->
29 <para>
30 The #GtkOptionMenu-struct struct contains private data only, and 
31 should be accessed using the functions below.
32 </para>
33
34
35 <!-- ##### FUNCTION gtk_option_menu_new ##### -->
36 <para>
37 Creates a new #GtkOptionMenu.
38 </para>
39
40 @Returns: a new #GtkOptionMenu.
41
42
43 <!-- ##### FUNCTION gtk_option_menu_get_menu ##### -->
44 <para>
45 Returns the #GtkMenu associated with the #GtkOptionMenu.
46 </para>
47
48 @option_menu: a #GtkOptionMenu.
49 @Returns: the #GtkMenu associated with the #GtkOptionMenu.
50
51
52 <!-- ##### FUNCTION gtk_option_menu_set_menu ##### -->
53 <para>
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.
57 </para>
58
59 @option_menu: a #GtkOptionMenu.
60 @menu: the #GtkMenu to associate with the #GtkOptionMenu.
61
62
63 <!-- ##### FUNCTION gtk_option_menu_remove_menu ##### -->
64 <para>
65 Removes the menu from the option menu.
66 </para>
67
68 @option_menu: a #GtkOptionMenu.
69
70
71 <!-- ##### FUNCTION gtk_option_menu_set_history ##### -->
72 <para>
73 Selects the menu item specified by @index making it the newly
74 selected value for the option menu.
75 </para>
76
77 @option_menu: a #GtkOptionMenu.
78 @index: the index of the menu item to select.  Index values are from 
79 0 to n-1.
80
81
82 <!-- ##### FUNCTION gtk_option_menu_get_history ##### -->
83 <para>
84
85 </para>
86
87 @option_menu: 
88 @Returns: 
89
90
91 <!-- ##### SIGNAL GtkOptionMenu::changed ##### -->
92 <para>
93
94 </para>
95
96 @optionmenu: the object which received the signal.
97
98 <!-- ##### ARG GtkOptionMenu:menu ##### -->
99 <para>
100
101 </para>
102