1 2@c %start of fragment 3 4@deftp Class <gtk-menu-item> 5Derives from @code{<gtk-item>}. 6 7This class defines the following slots: 8 9@table @code 10@item submenu 11The submenu attached to the menu item, or NULL if it has none 12 13@end table 14 15@end deftp 16 17@defop Signal <gtk-menu-item> activate 18Emitted when the item is activated. 19 20@end defop 21 22@defop Signal <gtk-menu-item> activate-item 23Emitted when the item is activated, but also if the menu item has a submenu. For 24normal applications, the relevant signal is "activate". 25 26@end defop 27 28@defop Signal <gtk-menu-item> toggle-size-request (arg0@tie{}@code{<gpointer>}) 29@end defop 30 31@defop Signal <gtk-menu-item> toggle-size-allocate (arg0@tie{}@code{<gint>}) 32@end defop 33 34@deffn Function gtk-menu-item-new @result{}@tie{} (ret@tie{}@code{<gtk-widget>}) 35Creates a new @code{<gtk-menu-item>}. 36 37@table @var 38@item ret 39the newly created @code{<gtk-menu-item>} 40 41@end table 42 43@end deffn 44 45@deffn Function gtk-menu-item-new-with-label (label@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>}) 46Creates a new @code{<gtk-menu-item>} whose child is a @code{<gtk-label>}. 47 48@table @var 49@item label 50the text for the label 51 52@item ret 53the newly created @code{<gtk-menu-item>} 54 55@end table 56 57@end deffn 58 59@deffn Function gtk-menu-item-new-with-mnemonic (label@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>}) 60Creates a new @code{<gtk-menu-item>} containing a label. The label will be 61created using @code{gtk-label-new-with-mnemonic}, so underscores in @var{label} 62indicate the mnemonic for the menu item. 63 64@table @var 65@item label 66The text of the button, with an underscore in front of the mnemonic character 67 68@item ret 69a new @code{<gtk-menu-item>} 70 71@end table 72 73@end deffn 74 75@deffn Function gtk-menu-item-set-right-justified (self@tie{}@code{<gtk-menu-item>}) (right_justified@tie{}@code{bool}) 76@deffnx Method set-right-justified 77Sets whether the menu item appears justified at the right side of a menu bar. 78This was traditionally done for "Help" menu items, but is now considered a bad 79idea. (If the widget layout is reversed for a right-to-left language like Hebrew 80or Arabic, right-justified-menu-items appear at the left.) 81 82@table @var 83@item menu-item 84a @code{<gtk-menu-item>}. 85 86@item right-justified 87if @samp{@code{#t}} the menu item will appear at the far right if added to a 88menu bar. 89 90@end table 91 92@end deffn 93 94@deffn Function gtk-menu-item-set-submenu (self@tie{}@code{<gtk-menu-item>}) (submenu@tie{}@code{<gtk-widget>}) 95@deffnx Method set-submenu 96Sets the widget submenu, or changes it. 97 98@table @var 99@item menu-item 100the menu item widget 101 102@item submenu 103the submenu 104 105@end table 106 107@end deffn 108 109@deffn Function gtk-menu-item-set-accel-path (self@tie{}@code{<gtk-menu-item>}) (accel_path@tie{}@code{mchars}) 110@deffnx Method set-accel-path 111Set the accelerator path on @var{menu-item}, through which runtime changes of 112the menu item's accelerator caused by the user can be identified and saved to 113persistant storage (see @code{gtk-accel-map-save} on this). To setup a default 114accelerator for this menu item, call @code{gtk-accel-map-add-entry} with the 115same @var{accel-path}. See also @code{gtk-accel-map-add-entry} on the specifics 116of accelerator paths, and @code{gtk-menu-set-accel-path} for a more convenient 117variant of this function. 118 119This function is basically a convenience wrapper that handles calling 120@code{gtk-widget-set-accel-path} with the appropriate accelerator group for the 121menu item. 122 123Note that you do need to set an accelerator on the parent menu with 124@code{gtk-menu-set-accel-group} for this to work. 125 126@table @var 127@item menu-item 128a valid @code{<gtk-menu-item>} 129 130@item accel-path 131accelerator path, corresponding to this menu item's functionality, or 132@samp{@code{#f}} to unset the current path. 133 134@end table 135 136@end deffn 137 138@deffn Function gtk-menu-item-remove-submenu (self@tie{}@code{<gtk-menu-item>}) 139@deffnx Method remove-submenu 140Removes the widget's submenu. 141 142@table @var 143@item menu-item 144the menu item widget 145 146@end table 147 148@end deffn 149 150@deffn Function gtk-menu-item-select (self@tie{}@code{<gtk-menu-item>}) 151@deffnx Method select 152Emits the "select" signal on the given item. Behaves exactly like 153@code{<gtk-item-select>}. 154 155@table @var 156@item menu-item 157the menu item 158 159@end table 160 161@end deffn 162 163@deffn Function gtk-menu-item-deselect (self@tie{}@code{<gtk-menu-item>}) 164@deffnx Method deselect 165Emits the "deselect" signal on the given item. Behaves exactly like 166@code{<gtk-item-deselect>}. 167 168@table @var 169@item menu-item 170the menu item 171 172@end table 173 174@end deffn 175 176@deffn Function gtk-menu-item-activate (self@tie{}@code{<gtk-menu-item>}) 177@deffnx Method activate 178Emits the "activate" signal on the given item 179 180@table @var 181@item menu-item 182the menu item 183 184@end table 185 186@end deffn 187 188@deffn Function gtk-menu-item-toggle-size-request (self@tie{}@code{<gtk-menu-item>}) @result{}@tie{} (requisition@tie{}@code{int}) 189@deffnx Method toggle-size-request 190Emits the "toggle_size_request" signal on the given item. 191 192@table @var 193@item menu-item 194the menu item 195 196@item requisition 197the requisition to use as signal data. 198 199@end table 200 201@end deffn 202 203@deffn Function gtk-menu-item-toggle-size-allocate (self@tie{}@code{<gtk-menu-item>}) (allocation@tie{}@code{int}) 204@deffnx Method toggle-size-allocate 205Emits the "toggle_size_allocate" signal on the given item. 206 207@table @var 208@item menu-item 209the menu item. 210 211@item allocation 212the allocation to use as signal data. 213 214@end table 215 216@end deffn 217 218@deffn Function gtk-menu-item-get-right-justified (self@tie{}@code{<gtk-menu-item>}) @result{}@tie{} (ret@tie{}@code{bool}) 219@deffnx Method get-right-justified 220Gets whether the menu item appears justified at the right side of the menu bar. 221 222@table @var 223@item menu-item 224a @code{<gtk-menu-item>} 225 226@item ret 227@samp{@code{#t}} if the menu item will appear at the far right if added to a 228menu bar. 229 230@end table 231 232@end deffn 233 234@deffn Function gtk-menu-item-get-submenu (self@tie{}@code{<gtk-menu-item>}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>}) 235@deffnx Method get-submenu 236Gets the submenu underneath this menu item, if any. See 237@code{gtk-menu-item-set-submenu}. 238 239@table @var 240@item menu-item 241a @code{<gtk-menu-item>} 242 243@item ret 244submenu for this menu item, or @samp{@code{#f}} if none. 245 246@end table 247 248@end deffn 249 250 251@c %end of fragment 252