gi-adwaita-1.0.1: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Adw.Objects.SplitButton

Description

A combined button and dropdown widget.

AdwSplitButton is typically used to present a set of actions in a menu, but allow access to one of them with a single click.

The API is very similar to Button and MenuButton, see their documentation for details.

CSS nodes

splitbutton[.image-button][.text-button]
├── button
│   ╰── <content>
├── separator
╰── menubutton
    ╰── button.toggle
        ╰── arrow

AdwSplitButton's CSS node is called splitbutton. It contains the css nodes: button, separator, menubutton. See MenuButton documentation for the menubutton contents.

The main CSS node will contain the .image-button or .text-button style classes matching the button contents. The nested button nodes will never contain them.

Accessibility

AdwSplitButton uses the GTK_ACCESSIBLE_ROLE_BUTTON role.

Since: 1.0

Synopsis

Exported types

class (GObject o, IsDescendantOf SplitButton o) => IsSplitButton o Source #

Type class for types which can be safely cast to SplitButton, for instance with toSplitButton.

Instances

Instances details
(GObject o, IsDescendantOf SplitButton o) => IsSplitButton o Source # 
Instance details

Defined in GI.Adw.Objects.SplitButton

toSplitButton :: (MonadIO m, IsSplitButton o) => o -> m SplitButton Source #

Cast to SplitButton, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, popdown, popup, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getActionName, getActionTargetValue, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getIconName, getLabel, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMenuModel, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPopover, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getUseUnderline, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setActionName, setActionTargetValue, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDetailedActionName, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setIconName, setLabel, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMenuModel, setName, setOpacity, setOverflow, setParent, setPopover, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible.

getChild

splitButtonGetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m (Maybe Widget)

Returns: the child widget

Gets the child widget.

Since: 1.0

getDirection

splitButtonGetDirection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m ArrowType

Returns: the direction

Gets the direction in which the popup will be popped up.

Since: 1.0

getIconName

splitButtonGetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m (Maybe Text)

Returns: the icon name

Gets the name of the icon used to automatically populate the button.

If the icon name has not been set with splitButtonSetIconName the return value will be NULL.

Since: 1.0

getLabel

splitButtonGetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m (Maybe Text)

Returns: the label for self

Gets the label for self.

Since: 1.0

getMenuModel

splitButtonGetMenuModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m (Maybe MenuModel)

Returns: the menu model

Gets the menu model from which the popup will be created.

Since: 1.0

getPopover

splitButtonGetPopover Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m (Maybe Popover)

Returns: the popover

Gets the popover that will be popped up when the dropdown is clicked.

Since: 1.0

getUseUnderline

splitButtonGetUseUnderline Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m Bool

Returns: whether an underline in the text indicates a mnemonic

Gets whether an underline in the text indicates a mnemonic.

Since: 1.0

new

splitButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m SplitButton

Returns: the newly created AdwSplitButton

Creates a new AdwSplitButton.

Since: 1.0

popdown

splitButtonPopdown Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m () 

Dismisses the menu.

Since: 1.0

popup

splitButtonPopup Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> m () 

Pops up the menu.

Since: 1.0

setChild

splitButtonSetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a, IsWidget b) 
=> a

self: a AdwSplitButton

-> Maybe b

child: the new child widget

-> m () 

Sets the child widget.

Since: 1.0

setDirection

splitButtonSetDirection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> ArrowType

direction: the direction

-> m () 

Sets the direction in which the popup will be popped up.

Since: 1.0

setIconName

splitButtonSetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> Text

iconName: the icon name to set

-> m () 

Sets the name of the icon used to automatically populate the button.

Since: 1.0

setLabel

splitButtonSetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> Text

label: the label to set

-> m () 

Sets the label for self.

Since: 1.0

setMenuModel

splitButtonSetMenuModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a, IsMenuModel b) 
=> a

self: a AdwSplitButton

-> Maybe b

menuModel: the menu model

-> m () 

Sets the menu model from which the popup will be created.

Since: 1.0

setPopover

splitButtonSetPopover Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a, IsPopover b) 
=> a

self: a AdwSplitButton

-> Maybe b

popover: the popover

-> m () 

Sets the popover that will be popped up when the dropdown is clicked.

Since: 1.0

setUseUnderline

splitButtonSetUseUnderline Source #

Arguments

:: (HasCallStack, MonadIO m, IsSplitButton a) 
=> a

self: a AdwSplitButton

-> Bool

useUnderline: whether an underline in the text indicates a mnemonic

-> m () 

Sets whether an underline in the text indicates a mnemonic.

Since: 1.0

Properties

child

The child widget.

Setting the child widget will set SplitButton:label and SplitButton:iconName to NULL.

Since: 1.0

clearSplitButtonChild :: (MonadIO m, IsSplitButton o) => o -> m () Source #

Set the value of the “child” property to Nothing. When overloading is enabled, this is equivalent to

clear #child

constructSplitButtonChild :: (IsSplitButton o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “child” property. This is rarely needed directly, but it is used by new.

getSplitButtonChild :: (MonadIO m, IsSplitButton o) => o -> m (Maybe Widget) Source #

Get the value of the “child” property. When overloading is enabled, this is equivalent to

get splitButton #child

setSplitButtonChild :: (MonadIO m, IsSplitButton o, IsWidget a) => o -> a -> m () Source #

Set the value of the “child” property. When overloading is enabled, this is equivalent to

set splitButton [ #child := value ]

direction

The direction in which the popup will be popped up.

The dropdown arrow icon will point at the same direction.

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, it's equivalent to GTK_ARROW_DOWN.

Since: 1.0

constructSplitButtonDirection :: (IsSplitButton o, MonadIO m) => ArrowType -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “direction” property. This is rarely needed directly, but it is used by new.

getSplitButtonDirection :: (MonadIO m, IsSplitButton o) => o -> m ArrowType Source #

Get the value of the “direction” property. When overloading is enabled, this is equivalent to

get splitButton #direction

setSplitButtonDirection :: (MonadIO m, IsSplitButton o) => o -> ArrowType -> m () Source #

Set the value of the “direction” property. When overloading is enabled, this is equivalent to

set splitButton [ #direction := value ]

iconName

The name of the icon used to automatically populate the button.

Setting the icon name will set SplitButton:label and SplitButton:child to NULL.

Since: 1.0

constructSplitButtonIconName :: (IsSplitButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “icon-name” property. This is rarely needed directly, but it is used by new.

getSplitButtonIconName :: (MonadIO m, IsSplitButton o) => o -> m (Maybe Text) Source #

Get the value of the “icon-name” property. When overloading is enabled, this is equivalent to

get splitButton #iconName

setSplitButtonIconName :: (MonadIO m, IsSplitButton o) => o -> Text -> m () Source #

Set the value of the “icon-name” property. When overloading is enabled, this is equivalent to

set splitButton [ #iconName := value ]

label

The label for the button.

Setting the label will set SplitButton:iconName and SplitButton:child to NULL.

Since: 1.0

constructSplitButtonLabel :: (IsSplitButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “label” property. This is rarely needed directly, but it is used by new.

getSplitButtonLabel :: (MonadIO m, IsSplitButton o) => o -> m (Maybe Text) Source #

Get the value of the “label” property. When overloading is enabled, this is equivalent to

get splitButton #label

setSplitButtonLabel :: (MonadIO m, IsSplitButton o) => o -> Text -> m () Source #

Set the value of the “label” property. When overloading is enabled, this is equivalent to

set splitButton [ #label := value ]

menuModel

The GMenuModel from which the popup will be created.

If the menu model is NULL, the dropdown is disabled.

A Popover will be created from the menu model with popoverMenuNewFromModel. Actions will be connected as documented for this function.

If SplitButton:popover is already set, it will be dissociated from the button, and the property is set to NULL.

Since: 1.0

clearSplitButtonMenuModel :: (MonadIO m, IsSplitButton o) => o -> m () Source #

Set the value of the “menu-model” property to Nothing. When overloading is enabled, this is equivalent to

clear #menuModel

constructSplitButtonMenuModel :: (IsSplitButton o, MonadIO m, IsMenuModel a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “menu-model” property. This is rarely needed directly, but it is used by new.

getSplitButtonMenuModel :: (MonadIO m, IsSplitButton o) => o -> m (Maybe MenuModel) Source #

Get the value of the “menu-model” property. When overloading is enabled, this is equivalent to

get splitButton #menuModel

setSplitButtonMenuModel :: (MonadIO m, IsSplitButton o, IsMenuModel a) => o -> a -> m () Source #

Set the value of the “menu-model” property. When overloading is enabled, this is equivalent to

set splitButton [ #menuModel := value ]

popover

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

If the popover is NULL, the dropdown is disabled.

If SplitButton:menuModel is set, the menu model is dissociated from the button, and the property is set to NULL.

Since: 1.0

clearSplitButtonPopover :: (MonadIO m, IsSplitButton o) => o -> m () Source #

Set the value of the “popover” property to Nothing. When overloading is enabled, this is equivalent to

clear #popover

constructSplitButtonPopover :: (IsSplitButton o, MonadIO m, IsPopover a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “popover” property. This is rarely needed directly, but it is used by new.

getSplitButtonPopover :: (MonadIO m, IsSplitButton o) => o -> m (Maybe Popover) Source #

Get the value of the “popover” property. When overloading is enabled, this is equivalent to

get splitButton #popover

setSplitButtonPopover :: (MonadIO m, IsSplitButton o, IsPopover a) => o -> a -> m () Source #

Set the value of the “popover” property. When overloading is enabled, this is equivalent to

set splitButton [ #popover := value ]

useUnderline

Whether an underline in the text indicates a mnemonic.

See SplitButton:label.

Since: 1.0

constructSplitButtonUseUnderline :: (IsSplitButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “use-underline” property. This is rarely needed directly, but it is used by new.

getSplitButtonUseUnderline :: (MonadIO m, IsSplitButton o) => o -> m Bool Source #

Get the value of the “use-underline” property. When overloading is enabled, this is equivalent to

get splitButton #useUnderline

setSplitButtonUseUnderline :: (MonadIO m, IsSplitButton o) => o -> Bool -> m () Source #

Set the value of the “use-underline” property. When overloading is enabled, this is equivalent to

set splitButton [ #useUnderline := value ]

Signals

activate

type SplitButtonActivateCallback = IO () Source #

Emitted to animate press then release.

This is an action signal. Applications should never connect to this signal, but use the SplitButton::clicked signal.

Since: 1.0

afterSplitButtonActivate :: (IsSplitButton a, MonadIO m) => a -> ((?self :: a) => SplitButtonActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after splitButton #activate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSplitButtonActivate :: (IsSplitButton a, MonadIO m) => a -> ((?self :: a) => SplitButtonActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on splitButton #activate callback

clicked

type SplitButtonClickedCallback = IO () Source #

Emitted when the button has been activated (pressed and released).

Since: 1.0

afterSplitButtonClicked :: (IsSplitButton a, MonadIO m) => a -> ((?self :: a) => SplitButtonClickedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the clicked signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after splitButton #clicked callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSplitButtonClicked :: (IsSplitButton a, MonadIO m) => a -> ((?self :: a) => SplitButtonClickedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the clicked signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on splitButton #clicked callback