1 2@c %start of fragment 3 4@deftp Class <gtk-menu-shell> 5Derives from @code{<gtk-container>}. 6 7This class defines the following slots: 8 9@table @code 10@item take-focus 11A boolean that determines whether the menu grabs the keyboard focus 12 13@end table 14 15@end deftp 16 17@defop Signal <gtk-menu-shell> deactivate 18This signal is emitted when a menu shell is deactivated. 19 20@end defop 21 22@defop Signal <gtk-menu-shell> selection-done 23This signal is emitted when a selection has been completed within a menu shell. 24 25@end defop 26 27@defop Signal <gtk-menu-shell> move-current (arg0@tie{}@code{<gtk-menu-direction-type>}) 28An action signal which moves the current menu item in the direction specified by 29@var{direction}. 30 31@end defop 32 33@defop Signal <gtk-menu-shell> activate-current (arg0@tie{}@code{<gboolean>}) 34An action signal that activates the current menu item within the menu shell. 35 36@end defop 37 38@defop Signal <gtk-menu-shell> cancel 39An action signal which cancels the selection within the menu shell. Causes the 40GtkMenuShell::selection-done signal to be emitted. 41 42@end defop 43 44@defop Signal <gtk-menu-shell> cycle-focus (arg0@tie{}@code{<gtk-direction-type>}) 45@end defop 46 47@defop Signal <gtk-menu-shell> move-selected (arg0@tie{}@code{<gint>}) @result{}@tie{}@code{<gboolean>} 48undocumented 49@end defop 50 51@deffn Function gtk-menu-shell-append (self@tie{}@code{<gtk-menu-shell>}) (child@tie{}@code{<gtk-widget>}) 52@deffnx Method append 53Adds a new @code{<gtk-menu-item>} to the end of the menu shell's item list. 54 55@table @var 56@item menu-shell 57a @code{<gtk-menu-shell>}. 58 59@item child 60The @code{<gtk-menu-item>} to add. 61 62@end table 63 64@end deffn 65 66@deffn Function gtk-menu-shell-prepend (self@tie{}@code{<gtk-menu-shell>}) (child@tie{}@code{<gtk-widget>}) 67@deffnx Method prepend 68Adds a new @code{<gtk-menu-item>} to the beginning of the menu shell's item 69list. 70 71@table @var 72@item menu-shell 73a @code{<gtk-menu-shell>}. 74 75@item child 76The @code{<gtk-menu-item>} to add. 77 78@end table 79 80@end deffn 81 82@deffn Function gtk-menu-shell-insert (self@tie{}@code{<gtk-menu-shell>}) (child@tie{}@code{<gtk-widget>}) (position@tie{}@code{int}) 83@deffnx Method insert 84Adds a new @code{<gtk-menu-item>} to the menu shell's item list at the position 85indicated by @var{position}. 86 87@table @var 88@item menu-shell 89a @code{<gtk-menu-shell>}. 90 91@item child 92The @code{<gtk-menu-item>} to add. 93 94@item position 95The position in the item list where @var{child} is added. Positions are numbered 96from 0 to n-1. 97 98@end table 99 100@end deffn 101 102@deffn Function gtk-menu-shell-deactivate (self@tie{}@code{<gtk-menu-shell>}) 103@deffnx Method deactivate 104Deactivates the menu shell. Typically this results in the menu shell being 105erased from the screen. 106 107@table @var 108@item menu-shell 109a @code{<gtk-menu-shell>}. 110 111@end table 112 113@end deffn 114 115@deffn Function gtk-menu-shell-select-item (self@tie{}@code{<gtk-menu-shell>}) (menu_item@tie{}@code{<gtk-widget>}) 116@deffnx Method select-item 117Selects the menu item from the menu shell. 118 119@table @var 120@item menu-shell 121a @code{<gtk-menu-shell>}. 122 123@item menu-item 124The @code{<gtk-menu-item>} to select. 125 126@end table 127 128@end deffn 129 130@deffn Function gtk-menu-shell-select-first (self@tie{}@code{<gtk-menu-shell>}) (search_sensitive@tie{}@code{bool}) 131@deffnx Method select-first 132Select the first visible or selectable child of the menu shell; don't select 133tearoff items unless the only item is a tearoff item. 134 135@table @var 136@item menu-shell 137a @code{<gtk-menu-shell>} 138 139@item search-sensitive 140if @samp{@code{#t}}, search for the first selectable menu item, otherwise select 141nothing if the first item isn't sensitive. This should be @samp{@code{#f}} if 142the menu is being popped up initially. 143 144@end table 145 146Since 2.2 147 148@end deffn 149 150@deffn Function gtk-menu-shell-deselect (self@tie{}@code{<gtk-menu-shell>}) 151@deffnx Method deselect 152Deselects the currently selected item from the menu shell, if any. 153 154@table @var 155@item menu-shell 156a @code{<gtk-menu-shell>}. 157 158@end table 159 160@end deffn 161 162@deffn Function gtk-menu-shell-activate-item (self@tie{}@code{<gtk-menu-shell>}) (menu_item@tie{}@code{<gtk-widget>}) (force_deactivate@tie{}@code{bool}) 163@deffnx Method activate-item 164Activates the menu item within the menu shell. 165 166@table @var 167@item menu-shell 168a @code{<gtk-menu-shell>}. 169 170@item menu-item 171The @code{<gtk-menu-item>} to activate. 172 173@item force-deactivate 174If TRUE, force the deactivation of the menu shell after the menu item is 175activated. 176 177@end table 178 179@end deffn 180 181@deffn Function gtk-menu-shell-cancel (self@tie{}@code{<gtk-menu-shell>}) 182@deffnx Method cancel 183Cancels the selection within the menu shell. 184 185@table @var 186@item menu-shell 187a @code{<gtk-menu-shell>} 188 189@end table 190 191Since 2.4 192 193@end deffn 194 195@deffn Function gtk-menu-shell-set-take-focus (self@tie{}@code{<gtk-menu-shell>}) (take_focus@tie{}@code{bool}) 196@deffnx Method set-take-focus 197If @var{take-focus} is @samp{@code{#t}} (the default) the menu shell will take 198the keyboard focus so that it will receive all keyboard events which is needed 199to enable keyboard navigation in menus. 200 201Setting @var{take-focus} to @samp{@code{#f}} is useful only for special 202applications like virtual keyboard implementations which should not take 203keyboard focus. 204 205The @var{take-focus} state of a menu or menu bar is automatically propagated to 206submenus whenever a submenu is popped up, so you don't have to worry about 207recursively setting it for your entire menu hierarchy. Only when 208programmatically picking a submenu and popping it up manually, the 209@var{take-focus} property of the submenu needs to be set explicitely. 210 211Note that setting it to @samp{@code{#f}} has side-effects: 212 213If the focus is in some other app, it keeps the focus and keynav in the menu 214doesn't work. Consequently, keynav on the menu will only work if the focus is on 215some toplevel owned by the onscreen keyboard. 216 217To avoid confusing the user, menus with @var{take-focus} set to @samp{@code{#f}} 218should not display mnemonics or accelerators, since it cannot be guaranteed that 219they will work. 220 221See also @code{gdk-keyboard-grab} 222 223@table @var 224@item menu-shell 225a @code{<gtk-menu-shell>} 226 227@item take-focus 228@samp{@code{#t}} if the menu shell should take the keyboard focus on popup. 229 230@end table 231 232Since 2.8 233 234@end deffn 235 236@deffn Function gtk-menu-shell-get-take-focus (self@tie{}@code{<gtk-menu-shell>}) @result{}@tie{} (ret@tie{}@code{bool}) 237@deffnx Method get-take-focus 238Returns @samp{@code{#t}} if the menu shell will take the keyboard focus on 239popup. 240 241@table @var 242@item menu-shell 243a @code{<gtk-menu-shell>} 244 245@item ret 246@samp{@code{#t}} if the menu shell will take the keyboard focus on popup. 247 248@end table 249 250Since 2.8 251 252@end deffn 253 254 255@c %end of fragment 256