MenuShell
open class MenuShell : Container, MenuShellProtocol
A GtkMenuShell
is the abstract base class used to derive the
GtkMenu
and GtkMenuBar
subclasses.
A GtkMenuShell
is a container of GtkMenuItem
objects arranged
in a list which can be navigated, selected, and activated by the
user to perform application functions. A GtkMenuItem
can have a
submenu associated with it, allowing for nested hierarchical menus.
Terminology
A menu item can be “selected”, this means that it is displayed in the prelight state, and if it has a submenu, that submenu will be popped up.
A menu is “active” when it is visible onscreen and the user is selecting from it. A menubar is not active until the user clicks on one of its menuitems. When a menu is active, passing the mouse over a submenu will pop it up.
There is also is a concept of the current menu and a current menu item. The current menu item is the selected menu item that is furthest down in the hierarchy. (Every active menu shell does not necessarily contain a selected menu item, but if it does, then the parent menu shell must also contain a selected menu item.) The current menu is the menu that contains the current menu item. It will always have a GTK grab and receive all key presses.
The MenuShell
type acts as a reference-counted owner of an underlying GtkMenuShell
instance.
It provides the methods that can operate on this data type through MenuShellProtocol
conformance.
Use MenuShell
as a strong reference or owner of a GtkMenuShell
instance.
-
Designated initialiser from the underlying `C` data type.
This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the
MenuShell
instance.Declaration
Swift
@inlinable public init(_ op: UnsafeMutablePointer<GtkMenuShell>)
Parameters
op
pointer to the underlying object
-
Designated initialiser from a constant pointer to the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theMenuShell
instance.Declaration
Swift
@inlinable public init(_ op: UnsafePointer<GtkMenuShell>)
Parameters
op
pointer to the underlying object
-
Optional initialiser from a non-mutating
gpointer
to the underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theMenuShell
instance.Declaration
Swift
@inlinable override public init!(gpointer op: gpointer?)
Parameters
op
gpointer to the underlying object
-
Optional initialiser from a non-mutating
gconstpointer
to the underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theMenuShell
instance.Declaration
Swift
@inlinable override public init!(gconstpointer op: gconstpointer?)
Parameters
op
pointer to the underlying object
-
Optional initialiser from a constant pointer to the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theMenuShell
instance.Declaration
Swift
@inlinable public init!(_ op: UnsafePointer<GtkMenuShell>?)
Parameters
op
pointer to the underlying object
-
Optional initialiser from the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theMenuShell
instance.Declaration
Swift
@inlinable public init!(_ op: UnsafeMutablePointer<GtkMenuShell>?)
Parameters
op
pointer to the underlying object
-
Designated initialiser from the underlying
C
data type. Will retainGtkMenuShell
. i.e., ownership is transferred to theMenuShell
instance.Declaration
Swift
@inlinable public init(retaining op: UnsafeMutablePointer<GtkMenuShell>)
Parameters
op
pointer to the underlying object
-
Reference intialiser for a related type that implements
MenuShellProtocol
Will retainGtkMenuShell
.Declaration
Swift
@inlinable public init<T>(menuShell other: T) where T : MenuShellProtocol
Parameters
other
an instance of a related type that implements
MenuShellProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable override public init<T>(cPointer p: UnsafeMutablePointer<T>)
Parameters
cPointer
pointer to the underlying object
-
Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)
Parameters
cPointer
pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable override public init(raw p: UnsafeRawPointer)
Parameters
p
raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable override public init(retainingRaw raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable public required init(raw p: UnsafeMutableRawPointer)
Parameters
p
mutable raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable required public init(retainingRaw raw: UnsafeMutableRawPointer)
Parameters
raw
mutable raw pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable override public init(opaquePointer p: OpaquePointer)
Parameters
p
opaque pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
MenuShellProtocol
.Declaration
Swift
@inlinable override public init(retainingOpaquePointer p: OpaquePointer)
Parameters
p
opaque pointer to the underlying object