11.86Class GtkMenuShell

A base class for menu objects.

Class GtkMenuShell
Methods
activate_itemActivates the menu item within the menu shell.
appendAdds a new GtkMenuItem to the end of the menu shell's item list.
cancelCancels the selection within the menu shell.
deactivateDeactivates the menu shell. Typically this results in the menu shell being erased from the screen.
deselectDeselects the currently selected item from the menu shell, if any.
get_take_focusReturns true if the menu shell will take the keyboard focus on popup.
insertAdds a new GtkMenuItem to the menu shell's item list at the position indicated by position.
prependAdds a new GtkMenuItem to the beginning of the menu shell's item list.
select_firstSelect the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item.
select_itemSelects the menu item from the menu shell.
set_take_focusIf 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_currentAn action signal that activates the current menu item within the menu shell.
signal_cancelAn action signal which cancels the selection within the menu shell.
signal_cycle_focus.
signal_deactivateThis signal is emitted when a menu shell is deactivated.
signal_move_currentAn action signal which moves the current menu item in the direction specified by direction.
signal_move_selectedThe move-selected signal is emitted to move the selection to another item.
signal_selection_doneThis signal is emitted when a selection has been completed within a menu shell.

Methods

activate_item

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.

append

Adds a new GtkMenuItem to the end of the menu shell's item list.

GtkMenuShell.append( child )
child The GtkMenuItem to add.

cancel

Cancels the selection within the menu shell.

GtkMenuShell.cancel()

deactivate

Deactivates the menu shell. Typically this results in the menu shell being erased from the screen.

GtkMenuShell.deactivate()

deselect

Deselects the currently selected item from the menu shell, if any.

GtkMenuShell.deselect()

get_take_focus

Returns true if the menu shell will take the keyboard focus on popup.

GtkMenuShell.get_take_focus()
Returntrue 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.

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.

prepend

Adds a new GtkMenuItem to the beginning of the menu shell's item list.

GtkMenuShell.prepend( child )
child The GtkMenuItem to add.

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.

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.

select_item

Selects the menu item from the menu shell.

GtkMenuShell.select_item( menu_item )
menu_item The GtkMenuItem to select.

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.

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.

signal_activate_current

An action signal that activates the current menu item within the menu shell.

GtkMenuShell.signal_activate_current()

signal_cancel

An action signal which cancels the selection within the menu shell.

GtkMenuShell.signal_cancel()

Causes the GtkMenuShell::selection-done signal to be emitted.

signal_cycle_focus

.

GtkMenuShell.signal_cycle_focus()

signal_deactivate

This signal is emitted when a menu shell is deactivated.

GtkMenuShell.signal_deactivate()

signal_move_current

An action signal which moves the current menu item in the direction specified by direction.

GtkMenuShell.signal_move_current()

signal_move_selected

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.

signal_selection_done

This signal is emitted when a selection has been completed within a menu shell.

GtkMenuShell.signal_selection_done()
Made with http://www.falconpl.org