Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A ListBoxRow
used to choose from a list of items.
<picture> <source srcset="combo-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="combo-row.png" alt="combo-row"> </picture>
The AdwComboRow
widget allows the user to choose from a list of valid
choices. The row displays the selected choice. When activated, the row
displays a popover which allows the user to make a new choice.
Example of an AdwComboRow
UI definition:
xml code
<object class="AdwComboRow"> <property name="title" translatable="yes">Combo Row</property> <property name="model"> <object class="GtkStringList"> <items> <item translatable="yes">Foo</item> <item translatable="yes">Bar</item> <item translatable="yes">Baz</item> </items> </object> </property> </object>
The [propertycomboRow
:selected] and [propertycomboRow
:selected-item]
properties can be used to keep track of the selected item and react to their
changes.
AdwComboRow
mirrors DropDown
, see that widget for details.
AdwComboRow
is ListBoxRow:activatable if a model is set.
CSS nodes
AdwComboRow
has a main CSS node with name row
and the .combo
style
class.
Its popover has the node named popover
with the .menu
style class, it
contains a ScrolledWindow
, which in turn contains a
ListView
, both are accessible via their regular nodes.
Accessibility
AdwComboRow
uses the GTK_ACCESSIBLE_ROLE_COMBO_BOX
role.
Synopsis
- newtype ComboRow = ComboRow (ManagedPtr ComboRow)
- class (GObject o, IsDescendantOf ComboRow o) => IsComboRow o
- toComboRow :: (MonadIO m, IsComboRow o) => o -> m ComboRow
- comboRowGetExpression :: (HasCallStack, MonadIO m, IsComboRow a) => a -> m (Maybe Expression)
- comboRowGetFactory :: (HasCallStack, MonadIO m, IsComboRow a) => a -> m (Maybe ListItemFactory)
- comboRowGetListFactory :: (HasCallStack, MonadIO m, IsComboRow a) => a -> m (Maybe ListItemFactory)
- comboRowGetModel :: (HasCallStack, MonadIO m, IsComboRow a) => a -> m (Maybe ListModel)
- comboRowGetSelected :: (HasCallStack, MonadIO m, IsComboRow a) => a -> m Word32
- comboRowGetSelectedItem :: (HasCallStack, MonadIO m, IsComboRow a) => a -> m (Maybe Object)
- comboRowGetUseSubtitle :: (HasCallStack, MonadIO m, IsComboRow a) => a -> m Bool
- comboRowNew :: (HasCallStack, MonadIO m) => m ComboRow
- comboRowSetExpression :: (HasCallStack, MonadIO m, IsComboRow a, IsExpression b) => a -> Maybe b -> m ()
- comboRowSetFactory :: (HasCallStack, MonadIO m, IsComboRow a, IsListItemFactory b) => a -> Maybe b -> m ()
- comboRowSetListFactory :: (HasCallStack, MonadIO m, IsComboRow a, IsListItemFactory b) => a -> Maybe b -> m ()
- comboRowSetModel :: (HasCallStack, MonadIO m, IsComboRow a, IsListModel b) => a -> Maybe b -> m ()
- comboRowSetSelected :: (HasCallStack, MonadIO m, IsComboRow a) => a -> Word32 -> m ()
- comboRowSetUseSubtitle :: (HasCallStack, MonadIO m, IsComboRow a) => a -> Bool -> m ()
- clearComboRowExpression :: (MonadIO m, IsComboRow o) => o -> m ()
- constructComboRowExpression :: (IsComboRow o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o)
- getComboRowExpression :: (MonadIO m, IsComboRow o) => o -> m (Maybe Expression)
- setComboRowExpression :: (MonadIO m, IsComboRow o, IsExpression a) => o -> a -> m ()
- clearComboRowFactory :: (MonadIO m, IsComboRow o) => o -> m ()
- constructComboRowFactory :: (IsComboRow o, MonadIO m, IsListItemFactory a) => a -> m (GValueConstruct o)
- getComboRowFactory :: (MonadIO m, IsComboRow o) => o -> m (Maybe ListItemFactory)
- setComboRowFactory :: (MonadIO m, IsComboRow o, IsListItemFactory a) => o -> a -> m ()
- clearComboRowListFactory :: (MonadIO m, IsComboRow o) => o -> m ()
- constructComboRowListFactory :: (IsComboRow o, MonadIO m, IsListItemFactory a) => a -> m (GValueConstruct o)
- getComboRowListFactory :: (MonadIO m, IsComboRow o) => o -> m (Maybe ListItemFactory)
- setComboRowListFactory :: (MonadIO m, IsComboRow o, IsListItemFactory a) => o -> a -> m ()
- clearComboRowModel :: (MonadIO m, IsComboRow o) => o -> m ()
- constructComboRowModel :: (IsComboRow o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o)
- getComboRowModel :: (MonadIO m, IsComboRow o) => o -> m (Maybe ListModel)
- setComboRowModel :: (MonadIO m, IsComboRow o, IsListModel a) => o -> a -> m ()
- constructComboRowSelected :: (IsComboRow o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getComboRowSelected :: (MonadIO m, IsComboRow o) => o -> m Word32
- setComboRowSelected :: (MonadIO m, IsComboRow o) => o -> Word32 -> m ()
- getComboRowSelectedItem :: (MonadIO m, IsComboRow o) => o -> m (Maybe Object)
- constructComboRowUseSubtitle :: (IsComboRow o, MonadIO m) => Bool -> m (GValueConstruct o)
- getComboRowUseSubtitle :: (MonadIO m, IsComboRow o) => o -> m Bool
- setComboRowUseSubtitle :: (MonadIO m, IsComboRow o) => o -> Bool -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq ComboRow Source # | |
GObject ComboRow Source # | |
Defined in GI.Adw.Objects.ComboRow | |
ManagedPtrNewtype ComboRow Source # | |
Defined in GI.Adw.Objects.ComboRow toManagedPtr :: ComboRow -> ManagedPtr ComboRow | |
TypedObject ComboRow Source # | |
Defined in GI.Adw.Objects.ComboRow | |
HasParentTypes ComboRow Source # | |
Defined in GI.Adw.Objects.ComboRow | |
IsGValue (Maybe ComboRow) Source # | Convert |
Defined in GI.Adw.Objects.ComboRow gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ComboRow -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ComboRow) | |
type ParentTypes ComboRow Source # | |
Defined in GI.Adw.Objects.ComboRow type ParentTypes ComboRow = '[ActionRow, PreferencesRow, ListBoxRow, Widget, Object, Accessible, Actionable, Buildable, ConstraintTarget] |
class (GObject o, IsDescendantOf ComboRow o) => IsComboRow o Source #
Type class for types which can be safely cast to ComboRow
, for instance with toComboRow
.
Instances
(GObject o, IsDescendantOf ComboRow o) => IsComboRow o Source # | |
Defined in GI.Adw.Objects.ComboRow |
toComboRow :: (MonadIO m, IsComboRow o) => o -> m ComboRow Source #
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addPrefix, addSuffix, addTickCallback, allocate, bindProperty, bindPropertyFull, changed, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSelected, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getActionName, getActionTargetValue, getActivatable, getActivatableWidget, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getExpression, getFactory, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeader, getHeight, getHexpand, getHexpandSet, getIconName, getIndex, getLastChild, getLayoutManager, getListFactory, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getModel, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSelectable, getSelected, getSelectedItem, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSubtitle, getSubtitleLines, getSubtitleSelectable, getTemplateChild, getTitle, getTitleLines, getTitleSelectable, getTooltipMarkup, getTooltipText, getUseMarkup, getUseSubtitle, getUseUnderline, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setActionName, setActionTargetValue, setActivatable, setActivatableWidget, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDetailedActionName, setDirection, setExpression, setFactory, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHeader, setHexpand, setHexpandSet, setIconName, setLayoutManager, setListFactory, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setModel, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSelectable, setSelected, setSensitive, setSizeRequest, setStateFlags, setSubtitle, setSubtitleLines, setSubtitleSelectable, setTitle, setTitleLines, setTitleSelectable, setTooltipMarkup, setTooltipText, setUseMarkup, setUseSubtitle, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible.
getExpression
comboRowGetExpression Source #
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> m (Maybe Expression) | Returns: the expression used to obtain strings from items |
Gets the expression used to obtain strings from items.
getFactory
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> m (Maybe ListItemFactory) | Returns: the factory in use |
Gets the factory for populating list items.
getListFactory
comboRowGetListFactory Source #
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> m (Maybe ListItemFactory) | Returns: the factory in use |
Gets the factory for populating list items in the popup.
getModel
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> m (Maybe ListModel) | Returns: The model in use |
Gets the model that provides the displayed items.
getSelected
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> m Word32 | Returns: the position of the selected item, or
[const |
Gets the position of the selected item.
getSelectedItem
comboRowGetSelectedItem Source #
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> m (Maybe Object) | Returns: the selected item |
Gets the selected item.
getUseSubtitle
comboRowGetUseSubtitle Source #
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> m Bool | Returns: whether to use the current value as the subtitle |
Gets whether to use the current value as the subtitle.
new
:: (HasCallStack, MonadIO m) | |
=> m ComboRow | Returns: the newly created |
Creates a new AdwComboRow
.
setExpression
comboRowSetExpression Source #
:: (HasCallStack, MonadIO m, IsComboRow a, IsExpression b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the expression used to obtain strings from items.
The expression must have a value type of G_TYPE_STRING
.
It's used to bind strings to labels produced by the default factory if
[propertycomboRow
:factory] is not set, or when
[propertycomboRow
:use-subtitle] is set to TRUE
.
setFactory
:: (HasCallStack, MonadIO m, IsComboRow a, IsListItemFactory b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the factory for populating list items.
This factory is always used for the item in the row. It is also used for
items in the popup unless [propertycomboRow
:list-factory] is set.
setListFactory
comboRowSetListFactory Source #
:: (HasCallStack, MonadIO m, IsComboRow a, IsListItemFactory b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the factory for populating list items in the popup.
If this is not set, [propertycomboRow
:factory] is used.
setModel
:: (HasCallStack, MonadIO m, IsComboRow a, IsListModel b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the model that provides the displayed items.
setSelected
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> Word32 |
|
-> m () |
Selects the item at the given position.
setUseSubtitle
comboRowSetUseSubtitle Source #
:: (HasCallStack, MonadIO m, IsComboRow a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether to use the current value as the subtitle.
If you use a custom list item factory, you will need to give the row a
name conversion expression with [propertycomboRow
:expression].
If set to TRUE
, you should not access [propertyactionRow
:subtitle].
The subtitle is interpreted as Pango markup if
[propertypreferencesRow
:use-markup] is set to TRUE
.
Properties
expression
An expression used to obtain strings from items.
The expression must have a value type of G_TYPE_STRING
.
It's used to bind strings to labels produced by the default factory if
[propertycomboRow
:factory] is not set, or when
[propertycomboRow
:use-subtitle] is set to TRUE
.
clearComboRowExpression :: (MonadIO m, IsComboRow o) => o -> m () Source #
Set the value of the “expression
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#expression
constructComboRowExpression :: (IsComboRow o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “expression
” property. This is rarely needed directly, but it is used by new
.
getComboRowExpression :: (MonadIO m, IsComboRow o) => o -> m (Maybe Expression) Source #
Get the value of the “expression
” property.
When overloading is enabled, this is equivalent to
get
comboRow #expression
setComboRowExpression :: (MonadIO m, IsComboRow o, IsExpression a) => o -> a -> m () Source #
Set the value of the “expression
” property.
When overloading is enabled, this is equivalent to
set
comboRow [ #expression:=
value ]
factory
Factory for populating list items.
This factory is always used for the item in the row. It is also used for
items in the popup unless [propertycomboRow
:list-factory] is set.
clearComboRowFactory :: (MonadIO m, IsComboRow o) => o -> m () Source #
Set the value of the “factory
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#factory
constructComboRowFactory :: (IsComboRow o, MonadIO m, IsListItemFactory a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “factory
” property. This is rarely needed directly, but it is used by new
.
getComboRowFactory :: (MonadIO m, IsComboRow o) => o -> m (Maybe ListItemFactory) Source #
Get the value of the “factory
” property.
When overloading is enabled, this is equivalent to
get
comboRow #factory
setComboRowFactory :: (MonadIO m, IsComboRow o, IsListItemFactory a) => o -> a -> m () Source #
Set the value of the “factory
” property.
When overloading is enabled, this is equivalent to
set
comboRow [ #factory:=
value ]
listFactory
The factory for populating list items in the popup.
If this is not set, [propertycomboRow
:factory] is used.
clearComboRowListFactory :: (MonadIO m, IsComboRow o) => o -> m () Source #
Set the value of the “list-factory
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#listFactory
constructComboRowListFactory :: (IsComboRow o, MonadIO m, IsListItemFactory a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “list-factory
” property. This is rarely needed directly, but it is used by new
.
getComboRowListFactory :: (MonadIO m, IsComboRow o) => o -> m (Maybe ListItemFactory) Source #
Get the value of the “list-factory
” property.
When overloading is enabled, this is equivalent to
get
comboRow #listFactory
setComboRowListFactory :: (MonadIO m, IsComboRow o, IsListItemFactory a) => o -> a -> m () Source #
Set the value of the “list-factory
” property.
When overloading is enabled, this is equivalent to
set
comboRow [ #listFactory:=
value ]
model
The model that provides the displayed items.
clearComboRowModel :: (MonadIO m, IsComboRow o) => o -> m () Source #
Set the value of the “model
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#model
constructComboRowModel :: (IsComboRow o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “model
” property. This is rarely needed directly, but it is used by new
.
getComboRowModel :: (MonadIO m, IsComboRow o) => o -> m (Maybe ListModel) Source #
Get the value of the “model
” property.
When overloading is enabled, this is equivalent to
get
comboRow #model
setComboRowModel :: (MonadIO m, IsComboRow o, IsListModel a) => o -> a -> m () Source #
Set the value of the “model
” property.
When overloading is enabled, this is equivalent to
set
comboRow [ #model:=
value ]
selected
The position of the selected item.
If no item is selected, the property has the value
[constgtk
.INVALID_LIST_POSITION]
constructComboRowSelected :: (IsComboRow o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “selected
” property. This is rarely needed directly, but it is used by new
.
getComboRowSelected :: (MonadIO m, IsComboRow o) => o -> m Word32 Source #
Get the value of the “selected
” property.
When overloading is enabled, this is equivalent to
get
comboRow #selected
setComboRowSelected :: (MonadIO m, IsComboRow o) => o -> Word32 -> m () Source #
Set the value of the “selected
” property.
When overloading is enabled, this is equivalent to
set
comboRow [ #selected:=
value ]
selectedItem
The selected item.
getComboRowSelectedItem :: (MonadIO m, IsComboRow o) => o -> m (Maybe Object) Source #
Get the value of the “selected-item
” property.
When overloading is enabled, this is equivalent to
get
comboRow #selectedItem
useSubtitle
Whether to use the current value as the subtitle.
If you use a custom list item factory, you will need to give the row a
name conversion expression with [propertycomboRow
:expression].
If set to TRUE
, you should not access [propertyactionRow
:subtitle].
The subtitle is interpreted as Pango markup if
[propertypreferencesRow
:use-markup] is set to TRUE
.
constructComboRowUseSubtitle :: (IsComboRow o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “use-subtitle
” property. This is rarely needed directly, but it is used by new
.
getComboRowUseSubtitle :: (MonadIO m, IsComboRow o) => o -> m Bool Source #
Get the value of the “use-subtitle
” property.
When overloading is enabled, this is equivalent to
get
comboRow #useSubtitle
setComboRowUseSubtitle :: (MonadIO m, IsComboRow o) => o -> Bool -> m () Source #
Set the value of the “use-subtitle
” property.
When overloading is enabled, this is equivalent to
set
comboRow [ #useSubtitle:=
value ]