MenuButtonProtocol

public protocol MenuButtonProtocol : WidgetProtocol

The GtkMenuButton widget is used to display a popup when clicked.

An example GtkMenuButton

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.

  • ptr

    Untyped pointer to the underlying GtkMenuButton instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • menu_button_ptr Default implementation

    Typed 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)

MenuButton Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

MenuButton signals

  • Connect a Swift signal handler to the given, typed MenuButtonSignalName signal

    Declaration

    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 by userData

    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 a C signal handler to the given, typed MenuButtonSignalName signal

    Declaration

    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 by userData

    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:handler:) Extension method

    Emitted to when the menu button is activated.

    The activate signal on GtkMenuButton is an action signal and emitting it causes the button to pop up its menu.

    Note

    This represents the underlying activate signal

    Declaration

    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 method

    Typed activate signal for using the connect(signal:) methods

    Declaration

    Swift

    static var activateSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::always-show-arrow signal

    Declaration

    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 method

    Typed notify::always-show-arrow signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyAlwaysShowArrowSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::direction signal

    Declaration

    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 method

    Typed notify::direction signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyDirectionSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::has-frame signal

    Declaration

    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 method

    Typed notify::has-frame signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHasFrameSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::icon-name signal

    Declaration

    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 method

    Typed notify::icon-name signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyIconNameSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::label signal

    Declaration

    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 method

    Typed notify::label signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyLabelSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::menu-model signal

    Declaration

    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 method

    Typed notify::menu-model signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMenuModelSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::popover signal

    Declaration

    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 method

    Typed notify::popover signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPopoverSignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::primary signal

    Declaration

    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 method

    Typed notify::primary signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPrimarySignal: MenuButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::use-underline signal

    Declaration

    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 method

    Typed notify::use-underline signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyUseUnderlineSignal: MenuButtonSignalName { get }

MenuButton Class: MenuButtonProtocol extension (methods and fields)

  • getAlwaysShowArrow() Extension method

    Gets whether to show a dropdown arrow even when using an icon.

    Declaration

    Swift

    @inlinable
    func getAlwaysShowArrow() -> Bool
  • getDirection() Extension method

    Returns the direction the popup will be pointing at when popped up.

    Declaration

    Swift

    @inlinable
    func getDirection() -> GtkArrowType
  • getHasFrame() Extension method

    Returns whether the button has a frame.

    Declaration

    Swift

    @inlinable
    func getHasFrame() -> Bool
  • getIconName() Extension method

    Gets the name of the icon shown in the button.

    Declaration

    Swift

    @inlinable
    func getIconName() -> String!
  • getLabel() Extension method

    Gets the label shown in the button

    Declaration

    Swift

    @inlinable
    func getLabel() -> String!
  • getMenuModel() Extension method

    Returns the GMenuModel used to generate the popup.

    Declaration

    Swift

    @inlinable
    func getMenuModel() -> GIO.MenuModelRef!
  • getPopover() Extension method

    Returns the GtkPopover that pops out of the button.

    If the button is not using a GtkPopover, this function returns nil.

    Declaration

    Swift

    @inlinable
    func getPopover() -> PopoverRef!
  • getPrimary() Extension method

    Returns whether the menu button acts as a primary menu.

    Declaration

    Swift

    @inlinable
    func getPrimary() -> Bool
  • getUseUnderline() Extension method

    Returns whether an embedded underline in the text indicates a mnemonic.

    Declaration

    Swift

    @inlinable
    func getUseUnderline() -> Bool
  • popdown() Extension method

    Dismiss the menu.

    Declaration

    Swift

    @inlinable
    func popdown()
  • popup() Extension method

    Pop 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)
  • Sets func to be called when a popup is about to be shown.

    func should use one of

    • [methodGtk.MenuButton.set_popover]
    • [methodGtk.MenuButton.set_menu_model]

    to set a popup for menu_button. If func 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 in func.

    Declaration

    Swift

    @inlinable
    func setCreatePopupFunc(func: GtkMenuButtonCreatePopupFunc? = nil, userData: gpointer! = nil, destroyNotify: GDestroyNotify? = nil)
  • 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 a direction, the popup will behave as if you passed GTK_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 is nil, the button is disabled.

    A [classGtk.Popover] will be created from the menu model with [ctorGtk.PopoverMenu.new_from_model]. Actions will be connected as documented for this function.

    If [propertyGtk.MenuButton:popover] is already set, it will be dissociated from the menu_button, and the property is set to nil.

    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 is nil, the button is disabled.

    A [classGtk.Popover] will be created from the menu model with [ctorGtk.PopoverMenu.new_from_model]. Actions will be connected as documented for this function.

    If [propertyGtk.MenuButton:popover] is already set, it will be dissociated from the menu_button, and the property is set to nil.

    Declaration

    Swift

    @inlinable
    func set<MenuModelT>(menuModel: MenuModelT?) where MenuModelT : MenuModelProtocol
  • set(popover:) Extension method

    Sets the GtkPopover that will be popped up when the menu_button is clicked.

    If popover is nil, the button is disabled.

    If [propertyGtk.MenuButton:menu-model] is set, the menu model is dissociated from the menu_button, and the property is set to nil.

    Declaration

    Swift

    @inlinable
    func set(popover: WidgetRef? = nil)
  • set(popover:) Extension method

    Sets the GtkPopover that will be popped up when the menu_button is clicked.

    If popover is nil, the button is disabled.

    If [propertyGtk.MenuButton:menu-model] is set, the menu model is dissociated from the menu_button, and the property is set to nil.

    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 method

    Gets whether to show a dropdown arrow even when using an icon.

    Declaration

    Swift

    @inlinable
    var alwaysShowArrow: Bool { get nonmutating set }
  • direction Extension method

    The 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 method

    Returns whether the button has a frame.

    Declaration

    Swift

    @inlinable
    var hasFrame: Bool { get nonmutating set }
  • iconName Extension method

    Gets the name of the icon shown in the button.

    Declaration

    Swift

    @inlinable
    var iconName: String! { get nonmutating set }
  • label Extension method

    The label for the button.

    Declaration

    Swift

    @inlinable
    var label: String! { get nonmutating set }
  • menuModel Extension method

    Returns the GMenuModel used to generate the popup.

    Declaration

    Swift

    @inlinable
    var menuModel: GIO.MenuModelRef! { get nonmutating set }
  • popover Extension method

    The GtkPopover that will be popped up when the button is clicked.

    Declaration

    Swift

    @inlinable
    var popover: PopoverRef! { get nonmutating set }
  • primary Extension method

    Whether 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 method

    Returns whether an embedded underline in the text indicates a mnemonic.

    Declaration

    Swift

    @inlinable
    var useUnderline: Bool { get nonmutating set }