A base class for menu objects.
Class GtkMenuShell
Methods | |
activate_item | Activates the menu item within the menu shell. |
append | Adds a new GtkMenuItem to the end of the menu shell's item list. |
cancel | Cancels the selection within the menu shell. |
deactivate | Deactivates the menu shell. Typically this results in the menu shell being erased from the screen. |
deselect | Deselects the currently selected item from the menu shell, if any. |
get_take_focus | Returns true if the menu shell will take the keyboard focus on popup. |
insert | Adds a new GtkMenuItem to the menu shell's item list at the position indicated by position. |
prepend | Adds a new GtkMenuItem to the beginning of the menu shell's item list. |
select_first | Select the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item. |
select_item | Selects the menu item from the menu shell. |
set_take_focus | If take_focus is TRUE (the default) the menu shell will take the keyboard focus so that it will receive all keyboard events which is needed to enable keyboard navigation in menus. |
signal_activate_current | An action signal that activates the current menu item within the menu shell. |
signal_cancel | An action signal which cancels the selection within the menu shell. |
signal_cycle_focus | . |
signal_deactivate | This signal is emitted when a menu shell is deactivated. |
signal_move_current | An action signal which moves the current menu item in the direction specified by direction. |
signal_move_selected | The move-selected signal is emitted to move the selection to another item. |
signal_selection_done | This signal is emitted when a selection has been completed within a menu shell. |
Activates the menu item within the menu shell.
GtkMenuShell.activate_item( menu_item, force_deactivate )
menu_item | The GtkMenuItem to activate |
force_deactivate | If true, force the deactivation of the menu shell after the menu item is activated. |
Adds a new GtkMenuItem to the end of the menu shell's item list.
GtkMenuShell.append( child )
child | The GtkMenuItem to add. |
Cancels the selection within the menu shell.
GtkMenuShell.cancel()
Deactivates the menu shell. Typically this results in the menu shell being erased from the screen.
GtkMenuShell.deactivate()
Deselects the currently selected item from the menu shell, if any.
GtkMenuShell.deselect()
Returns true if the menu shell will take the keyboard focus on popup.
GtkMenuShell.get_take_focus()
Return | true if the menu shell will take the keyboard focus on popup. |
Adds a new GtkMenuItem to the menu shell's item list at the position indicated by position.
GtkMenuShell.insert( child, position )
child | The GtkMenuItem to add. |
position | The position in the item list where child is added. Positions are numbered from 0 to n-1. |
Adds a new GtkMenuItem to the beginning of the menu shell's item list.
GtkMenuShell.prepend( child )
child | The GtkMenuItem to add. |
Select the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item.
GtkMenuShell.select_first( search_sensitive )
search_sensitive | if true, search for the first selectable menu item, otherwise select nothing if the first item isn't sensitive. This should be false if the menu is being popped up initially. |
Selects the menu item from the menu shell.
GtkMenuShell.select_item( menu_item )
menu_item | The GtkMenuItem to select. |
If take_focus is TRUE (the default) the menu shell will take the keyboard focus so that it will receive all keyboard events which is needed to enable keyboard navigation in menus.
GtkMenuShell.set_take_focus( take_focus )
take_focus | true if the menu shell should take the keyboard focus on popup. |
Setting take_focus to FALSE is useful only for special applications like virtual keyboard implementations which should not take keyboard focus.
The take_focus state of a menu or menu bar is automatically propagated to submenus whenever a submenu is popped up, so you don't have to worry about recursively setting it for your entire menu hierarchy. Only when programmatically picking a submenu and popping it up manually, the take_focus property of the submenu needs to be set explicitely.
Note that setting it to FALSE has side-effects: If the focus is in some other app, it keeps the focus and keynav in the menu doesn't work. Consequently, keynav on the menu will only work if the focus is on some toplevel owned by the onscreen keyboard.
To avoid confusing the user, menus with take_focus set to FALSE should not display mnemonics or accelerators, since it cannot be guaranteed that they will work.
An action signal that activates the current menu item within the menu shell.
GtkMenuShell.signal_activate_current()
An action signal which cancels the selection within the menu shell.
GtkMenuShell.signal_cancel()
Causes the GtkMenuShell::selection-done signal to be emitted.
.
GtkMenuShell.signal_cycle_focus()
This signal is emitted when a menu shell is deactivated.
GtkMenuShell.signal_deactivate()
An action signal which moves the current menu item in the direction specified by direction.
GtkMenuShell.signal_move_current()
The move-selected signal is emitted to move the selection to another item.
GtkMenuShell.signal_move_selected()
Return true to stop the signal emission, false to continue.
This signal is emitted when a selection has been completed within a menu shell.
GtkMenuShell.signal_selection_done()