W Wrapl, The Programming Language

Libraries:Gtk:Gtk:MenuShell

Types

T

Inherits from:

A T is the abstract base class used to derive the Gtk.Gtk.Menu.T and Gtk.Gtk.MenuBar.T subclasses.

A T is a container of Gtk.Gtk.MenuItem.T objects arranged in a list which can be navigated, selected, and activated by the user to perform application functions. A Gtk.Gtk.MenuItem.T can have a submenu associated with it, allowing for nested hierarchical menus.



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Methods

:ActivateItem(self @ T, menu_item @ Gtk.Gtk.Widget.T, force_deactivate @ Std.Symbol.T) : Std.Object.T

Activates the menu item within the menu shell.

menu_shell a T.
menu_item The Gtk.Gtk.MenuItem.T to activate.
force_deactivate If TRUE, force the deactivation of the menu shell after the menu item is activated.


:Append(self @ T, child @ Gtk.Gtk.Widget.T) : Std.Object.T

Adds a new Gtk.Gtk.MenuItem.T to the end of the menu shell's item list.

menu_shell a T.
child The Gtk.Gtk.MenuItem.T to add.


:Cancel(self @ T) : Std.Object.T

Cancels the selection within the menu shell.

menu_shell a T


:Deactivate(self @ T) : Std.Object.T

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

menu_shell a T.


:Deselect(self @ T) : Std.Object.T

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

menu_shell a T.


:GetTakeFocus(self @ T) : Std.Symbol.T

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

menu_shell a T
Returns TRUE if the menu shell will take the keyboard focus on popup.


:Insert(self @ T, child @ Gtk.Gtk.Widget.T, position @ Std.Integer.SmallT) : Std.Object.T

Adds a new Gtk.Gtk.MenuItem.T to the menu shell's item list at the position indicated by position.

menu_shell a T.
child The Gtk.Gtk.MenuItem.T to add.
position The position in the item list where child is added. Positions are numbered from 0 to n-1.


:Prepend(self @ T, child @ Gtk.Gtk.Widget.T) : Std.Object.T

Adds a new Gtk.Gtk.MenuItem.T to the beginning of the menu shell's item list.

menu_shell a T.
child The Gtk.Gtk.MenuItem.T to add.


:SelectFirst(self @ T, search_sensitive @ Std.Symbol.T) : Std.Object.T

Select the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item.

menu_shell a T
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.


:SelectItem(self @ T, menu_item @ Gtk.Gtk.Widget.T) : Std.Object.T

Selects the menu item from the menu shell.

menu_shell a T.
menu_item The Gtk.Gtk.MenuItem.T to select.


:SetTakeFocus(self @ T, take_focus @ Std.Symbol.T) : Std.Object.T

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

See also Gtk.Gdk.Keyboard.Grab

menu_shell a T
take_focus TRUE if the menu shell should take the keyboard focus on popup.