Package: gtk

Accessor gtk-menu-shell-take-focus

Lambda List

gtk-menu-shell-take-focus (object)

Syntax

(gtk-menu-shell-take-focus object) => take-focus
(setf (gtk-menu-shell-take-focus object) take-focus)

Arguments

object -- a gtk-menu-shell widget
take-focus -- true if the menu shell widget should take the keyboard focus on popup

Details

Accessor of the take-focus slot of the gtk-menu-shell class.

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. 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 do not 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

The setting of take-focus to false has side-effects. If the focus is in some other application, it keeps the focus and keyboard navigation in the menu does not work. Consequently, keyboard navigation 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.
 

See also

2021-7-17