MenuButtonProtocol
public protocol MenuButtonProtocol : WidgetProtocol
The GtkMenuButton
widget is used to display a popup when clicked.
This popup can be provided either as a GtkPopover
or as an abstract
GMenuModel
.
The GtkMenuButton
widget can show either an icon (set with the
[propertyGtk.MenuButton:icon-name
] property) or a label (set with the
[propertyGtk.MenuButton:label
] property). If neither is explicitly set,
a [classGtk.Image
] is automatically created, using an arrow image oriented
according to [propertyGtk.MenuButton:direction
] or the generic
“open-menu-symbolic” icon if the direction is not set.
The positioning of the popup is determined by the
[propertyGtk.MenuButton:direction
] property of the menu button.
For menus, the [propertyGtk.Widget:halign
] and [propertyGtk.Widget:valign
]
properties of the menu are also taken into account. For example, when the
direction is GTK_ARROW_DOWN
and the horizontal alignment is GTK_ALIGN_START
,
the menu will be positioned below the button, with the starting edge
(depending on the text direction) of the menu aligned with the starting
edge of the button. If there is not enough space below the button, the
menu is popped up above the button instead. If the alignment would move
part of the menu offscreen, it is “pushed in”.
start | center | end | |
---|---|---|---|
down | |||
up | |||
left | |||
right |
CSS nodes
menubutton
╰── button.toggle
╰── <content>
╰── [arrow]
GtkMenuButton
has a single CSS node with name menubutton
which contains a button
node with a .toggle
style class.
If the button contains only an icon or an arrow, it will have the
.image-button
style class, if it contains both, it will have the
.arrow-button
style class.
Inside the toggle button content, there is an arrow
node for
the indicator, which will carry one of the .none
, .up
, .down
,
.left
or .right
style classes to indicate the direction that
the menu will appear in. The CSS is expected to provide a suitable
image for each of these cases using the -gtk-icon-source
property.
Optionally, the menubutton
node can carry the .circular
style class
to request a round appearance.
Accessibility
GtkMenuButton
uses the GTK_ACCESSIBLE_ROLE_BUTTON
role.
The MenuButtonProtocol
protocol exposes the methods and properties of an underlying GtkMenuButton
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see MenuButton
.
Alternatively, use MenuButtonRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkMenuButton
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
menu_button_ptr
Default implementationTyped pointer to the underlying
GtkMenuButton
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkMenuButton
instance.Declaration
Swift
var menu_button_ptr: UnsafeMutablePointer<GtkMenuButton>! { get }
-
Required Initialiser for types conforming to
MenuButtonProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
MenuButtonPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: MenuButtonPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a MenuButton property
Declaration
Swift
@inlinable func get(property: MenuButtonPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a MenuButton property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: MenuButtonPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
MenuButtonSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: MenuButtonSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
MenuButtonSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: MenuButtonSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onActivate(flags:
Extension methodhandler: ) Emitted to when the menu button is activated.
The
activate
signal onGtkMenuButton
is an action signal and emitting it causes the button to pop up its menu.Note
This represents the underlyingactivate
signalDeclaration
Swift
@discardableResult @inlinable func onActivate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
activate
signal is emitted -
activateSignal
Extension methodTyped
activate
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var activateSignal: MenuButtonSignalName { get }
-
onNotifyAlwaysShowArrow(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::always-show-arrow
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyAlwaysShowArrow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyAlwaysShowArrow
signal is emitted -
notifyAlwaysShowArrowSignal
Extension methodTyped
notify::always-show-arrow
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyAlwaysShowArrowSignal: MenuButtonSignalName { get }
-
onNotifyDirection(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::direction
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyDirection(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyDirection
signal is emitted -
notifyDirectionSignal
Extension methodTyped
notify::direction
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyDirectionSignal: MenuButtonSignalName { get }
-
onNotifyHasFrame(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-frame
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasFrame(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasFrame
signal is emitted -
notifyHasFrameSignal
Extension methodTyped
notify::has-frame
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasFrameSignal: MenuButtonSignalName { get }
-
onNotifyIconName(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::icon-name
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyIconName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyIconName
signal is emitted -
notifyIconNameSignal
Extension methodTyped
notify::icon-name
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyIconNameSignal: MenuButtonSignalName { get }
-
onNotifyLabel(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::label
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyLabel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyLabel
signal is emitted -
notifyLabelSignal
Extension methodTyped
notify::label
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyLabelSignal: MenuButtonSignalName { get }
-
onNotifyMenuModel(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::menu-model
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMenuModel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMenuModel
signal is emitted -
notifyMenuModelSignal
Extension methodTyped
notify::menu-model
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMenuModelSignal: MenuButtonSignalName { get }
-
onNotifyPopover(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::popover
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPopover(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPopover
signal is emitted -
notifyPopoverSignal
Extension methodTyped
notify::popover
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPopoverSignal: MenuButtonSignalName { get }
-
onNotifyPrimary(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::primary
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPrimary(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPrimary
signal is emitted -
notifyPrimarySignal
Extension methodTyped
notify::primary
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPrimarySignal: MenuButtonSignalName { get }
-
onNotifyUseUnderline(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::use-underline
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyUseUnderline(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: MenuButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyUseUnderline
signal is emitted -
notifyUseUnderlineSignal
Extension methodTyped
notify::use-underline
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyUseUnderlineSignal: MenuButtonSignalName { get }
-
getAlwaysShowArrow()
Extension methodGets whether to show a dropdown arrow even when using an icon.
Declaration
Swift
@inlinable func getAlwaysShowArrow() -> Bool
-
getDirection()
Extension methodReturns the direction the popup will be pointing at when popped up.
Declaration
Swift
@inlinable func getDirection() -> GtkArrowType
-
getHasFrame()
Extension methodReturns whether the button has a frame.
Declaration
Swift
@inlinable func getHasFrame() -> Bool
-
getIconName()
Extension methodGets the name of the icon shown in the button.
Declaration
Swift
@inlinable func getIconName() -> String!
-
getLabel()
Extension methodGets the label shown in the button
Declaration
Swift
@inlinable func getLabel() -> String!
-
getMenuModel()
Extension methodReturns the
GMenuModel
used to generate the popup.Declaration
Swift
@inlinable func getMenuModel() -> GIO.MenuModelRef!
-
getPopover()
Extension methodReturns the
GtkPopover
that pops out of the button.If the button is not using a
GtkPopover
, this function returnsnil
.Declaration
Swift
@inlinable func getPopover() -> PopoverRef!
-
getPrimary()
Extension methodReturns whether the menu button acts as a primary menu.
Declaration
Swift
@inlinable func getPrimary() -> Bool
-
getUseUnderline()
Extension methodReturns whether an embedded underline in the text indicates a mnemonic.
Declaration
Swift
@inlinable func getUseUnderline() -> Bool
-
popdown()
Extension methodDismiss the menu.
Declaration
Swift
@inlinable func popdown()
-
popup()
Extension methodPop up the menu.
Declaration
Swift
@inlinable func popup()
-
set(alwaysShowArrow:
Extension method) Sets whether to show a dropdown arrow even when using an icon.
Declaration
Swift
@inlinable func set(alwaysShowArrow: Bool)
-
setCreatePopupFunc(func:
Extension methoduserData: destroyNotify: ) Sets
func
to be called when a popup is about to be shown.func
should use one of- [method
Gtk.MenuButton.set_popover
] - [method
Gtk.MenuButton.set_menu_model
]
to set a popup for
menu_button
. Iffunc
is non-nil
,menu_button
will always be sensitive.Using this function will not reset the menu widget attached to
menu_button
. Instead, this can be done manually infunc
.Declaration
Swift
@inlinable func setCreatePopupFunc(func: GtkMenuButtonCreatePopupFunc? = nil, userData: gpointer! = nil, destroyNotify: GDestroyNotify? = nil)
- [method
-
set(direction:
Extension method) Sets the direction in which the popup will be popped up.
If the button is automatically populated with an arrow icon, its direction will be changed to match.
If the does not fit in the available space in the given direction, GTK will its best to keep it inside the screen and fully visible.
If you pass
GTK_ARROW_NONE
for adirection
, the popup will behave as if you passedGTK_ARROW_DOWN
(although you won’t see any arrows).Declaration
Swift
@inlinable func set(direction: GtkArrowType)
-
set(hasFrame:
Extension method) Sets the style of the button.
Declaration
Swift
@inlinable func set(hasFrame: Bool)
-
set(iconName:
Extension method) Sets the name of an icon to show inside the menu button.
Declaration
Swift
@inlinable func set(iconName: UnsafePointer<CChar>!)
-
set(label:
Extension method) Sets the label to show inside the menu button.
Declaration
Swift
@inlinable func set(label: UnsafePointer<CChar>!)
-
set(menuModel:
Extension method) Sets the
GMenuModel
from which the popup will be constructed.If
menu_model
isnil
, the button is disabled.A [class
Gtk.Popover
] will be created from the menu model with [ctorGtk.PopoverMenu.new_from_model
]. Actions will be connected as documented for this function.If [property
Gtk.MenuButton:popover
] is already set, it will be dissociated from themenu_button
, and the property is set tonil
.Declaration
Swift
@inlinable func set(menuModel: GIO.MenuModelRef? = nil)
-
set(menuModel:
Extension method) Sets the
GMenuModel
from which the popup will be constructed.If
menu_model
isnil
, the button is disabled.A [class
Gtk.Popover
] will be created from the menu model with [ctorGtk.PopoverMenu.new_from_model
]. Actions will be connected as documented for this function.If [property
Gtk.MenuButton:popover
] is already set, it will be dissociated from themenu_button
, and the property is set tonil
.Declaration
Swift
@inlinable func set<MenuModelT>(menuModel: MenuModelT?) where MenuModelT : MenuModelProtocol
-
set(popover:
Extension method) Sets the
GtkPopover
that will be popped up when themenu_button
is clicked.If
popover
isnil
, the button is disabled.If [property
Gtk.MenuButton:menu-model
] is set, the menu model is dissociated from themenu_button
, and the property is set tonil
.Declaration
Swift
@inlinable func set(popover: WidgetRef? = nil)
-
set(popover:
Extension method) Sets the
GtkPopover
that will be popped up when themenu_button
is clicked.If
popover
isnil
, the button is disabled.If [property
Gtk.MenuButton:menu-model
] is set, the menu model is dissociated from themenu_button
, and the property is set tonil
.Declaration
Swift
@inlinable func set<WidgetT>(popover: WidgetT?) where WidgetT : WidgetProtocol
-
set(primary:
Extension method) Sets whether menu button acts as a primary menu.
Primary menus can be opened with the <kbd>F10</kbd> key.
Declaration
Swift
@inlinable func set(primary: Bool)
-
set(useUnderline:
Extension method) If true, an underline in the text indicates a mnemonic.
Declaration
Swift
@inlinable func set(useUnderline: Bool)
-
alwaysShowArrow
Extension methodGets whether to show a dropdown arrow even when using an icon.
Declaration
Swift
@inlinable var alwaysShowArrow: Bool { get nonmutating set }
-
direction
Extension methodThe
GtkArrowType
representing the direction in which the menu or popover will be popped out.Declaration
Swift
@inlinable var direction: GtkArrowType { get nonmutating set }
-
hasFrame
Extension methodReturns whether the button has a frame.
Declaration
Swift
@inlinable var hasFrame: Bool { get nonmutating set }
-
iconName
Extension methodGets the name of the icon shown in the button.
Declaration
Swift
@inlinable var iconName: String! { get nonmutating set }
-
label
Extension methodThe label for the button.
Declaration
Swift
@inlinable var label: String! { get nonmutating set }
-
menuModel
Extension methodReturns the
GMenuModel
used to generate the popup.Declaration
Swift
@inlinable var menuModel: GIO.MenuModelRef! { get nonmutating set }
-
popover
Extension methodThe
GtkPopover
that will be popped up when the button is clicked.Declaration
Swift
@inlinable var popover: PopoverRef! { get nonmutating set }
-
primary
Extension methodWhether the menu button acts as a primary menu.
Primary menus can be opened using the <kbd>F10</kbd> key
Declaration
Swift
@inlinable var primary: Bool { get nonmutating set }
-
useUnderline
Extension methodReturns whether an embedded underline in the text indicates a mnemonic.
Declaration
Swift
@inlinable var useUnderline: Bool { get nonmutating set }