gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.ListBoxRow

Contents

- Exported types
- Methods
  - changed
  - getActivatable
  - getChild
  - getHeader
  - getIndex
  - getSelectable
  - isSelected
  - new
  - setActivatable
  - setChild
  - setHeader
  - setSelectable
- Properties
  - activatable
  - child
  - selectable
- Signals
  - activate

Description

The kind of widget that can be added to a `GtkListBox`.

`ListBox` will automatically wrap its children in a `GtkListboxRow` when necessary.

Synopsis

- newtype ListBoxRow = ListBoxRow (ManagedPtr ListBoxRow)
- class (GObject o, IsDescendantOf ListBoxRow o) => IsListBoxRow o
- toListBoxRow :: (MonadIO m, IsListBoxRow o) => o -> m ListBoxRow
- listBoxRowChanged :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> m ()
- listBoxRowGetActivatable :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> m Bool
- listBoxRowGetChild :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> m (Maybe Widget)
- listBoxRowGetHeader :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> m (Maybe Widget)
- listBoxRowGetIndex :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> m Int32
- listBoxRowGetSelectable :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> m Bool
- listBoxRowIsSelected :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> m Bool
- listBoxRowNew :: (HasCallStack, MonadIO m) => m ListBoxRow
- listBoxRowSetActivatable :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> Bool -> m ()
- listBoxRowSetChild :: (HasCallStack, MonadIO m, IsListBoxRow a, IsWidget b) => a -> Maybe b -> m ()
- listBoxRowSetHeader :: (HasCallStack, MonadIO m, IsListBoxRow a, IsWidget b) => a -> Maybe b -> m ()
- listBoxRowSetSelectable :: (HasCallStack, MonadIO m, IsListBoxRow a) => a -> Bool -> m ()
- constructListBoxRowActivatable :: (IsListBoxRow o, MonadIO m) => Bool -> m (GValueConstruct o)
- getListBoxRowActivatable :: (MonadIO m, IsListBoxRow o) => o -> m Bool
- setListBoxRowActivatable :: (MonadIO m, IsListBoxRow o) => o -> Bool -> m ()
- clearListBoxRowChild :: (MonadIO m, IsListBoxRow o) => o -> m ()
- constructListBoxRowChild :: (IsListBoxRow o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getListBoxRowChild :: (MonadIO m, IsListBoxRow o) => o -> m (Maybe Widget)
- setListBoxRowChild :: (MonadIO m, IsListBoxRow o, IsWidget a) => o -> a -> m ()
- constructListBoxRowSelectable :: (IsListBoxRow o, MonadIO m) => Bool -> m (GValueConstruct o)
- getListBoxRowSelectable :: (MonadIO m, IsListBoxRow o) => o -> m Bool
- setListBoxRowSelectable :: (MonadIO m, IsListBoxRow o) => o -> Bool -> m ()
- type ListBoxRowActivateCallback = IO ()
- afterListBoxRowActivate :: (IsListBoxRow a, MonadIO m) => a -> ((?self :: a) => ListBoxRowActivateCallback) -> m SignalHandlerId
- onListBoxRowActivate :: (IsListBoxRow a, MonadIO m) => a -> ((?self :: a) => ListBoxRowActivateCallback) -> m SignalHandlerId

# Exported types

newtype ListBoxRow Source #

Memory-managed wrapper type.

Constructors

ListBoxRow (ManagedPtr ListBoxRow) |

#### Instances

Instances details

Eq ListBoxRow Source # |
Instance details Defined in GI.Gtk.Objects.ListBoxRow Methods (==) :: ListBoxRow -> ListBoxRow -> Bool Source # (/=) :: ListBoxRow -> ListBoxRow -> Bool Source #
GObject ListBoxRow Source # |
Instance details Defined in GI.Gtk.Objects.ListBoxRow
ManagedPtrNewtype ListBoxRow Source # |
Instance details Defined in GI.Gtk.Objects.ListBoxRow Methods toManagedPtr :: ListBoxRow -> ManagedPtr ListBoxRow Source #
TypedObject ListBoxRow Source # |
Instance details Defined in GI.Gtk.Objects.ListBoxRow Methods glibType :: IO GType Source #
HasParentTypes ListBoxRow Source # |
Instance details Defined in GI.Gtk.Objects.ListBoxRow
IsGValue (Maybe ListBoxRow) Source # | Convert `ListBoxRow` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.ListBoxRow Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ListBoxRow -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ListBoxRow) Source #
type ParentTypes ListBoxRow Source # |
Instance details Defined in GI.Gtk.Objects.ListBoxRow type ParentTypes ListBoxRow = '[Widget, Object, Accessible, Actionable, Buildable, ConstraintTarget]

class (GObject o, IsDescendantOf ListBoxRow o) => IsListBoxRow o Source #

Type class for types which can be safely cast to `ListBoxRow`, for instance with `toListBoxRow`.

#### Instances

Instances details

(GObject o, IsDescendantOf ListBoxRow o) => IsListBoxRow o Source # |
Instance details Defined in GI.Gtk.Objects.ListBoxRow

toListBoxRow :: (MonadIO m, IsListBoxRow o) => o -> m ListBoxRow Source #

Cast to `ListBoxRow`, 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, announce, 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, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getActionName, getActionTargetValue, getActivatable, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeader, getHeight, getHexpand, getHexpandSet, getIndex, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSelectable, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

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

## changed

listBoxRowChanged Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> m () |

Marks `row` as changed, causing any state that depends on this to be updated.

This affects sorting, filtering and headers.

Note that calls to this method must be in sync with the data used for the row functions. For instance, if the list is mirroring some external data set, and *two* rows changed in the external data set then when you call `listBoxRowChanged` on the first row the sort function must only read the new data for the first of the two changed rows, otherwise the resorting of the rows will be wrong.

This generally means that if you don’t fully control the data model you have to duplicate the data that affects the listbox row functions into the row widgets themselves. Another alternative is to call `listBoxInvalidateSort` on any model change, but that is more expensive.

## getActivatable

listBoxRowGetActivatable Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> m Bool | Returns: `True` if the row is activatable

Gets whether the row is activatable.

## getChild

listBoxRowGetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> m (Maybe Widget) | Returns: the child widget of `row`

Gets the child widget of `row`.

## getHeader

listBoxRowGetHeader Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> m (Maybe Widget) | Returns: the current header

Returns the current header of the `row`.

This can be used in a [callback`gtk`.ListBoxUpdateHeaderFunc] to see if there is a header set already, and if so to update the state of it.

## getIndex

listBoxRowGetIndex Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> m Int32 | Returns: the index of the `row`, or -1 if the `row` is not in a listbox

Gets the current index of the `row` in its `GtkListBox` container.

## getSelectable

listBoxRowGetSelectable Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> m Bool | Returns: `True` if the row is selectable

Gets whether the row can be selected.

## isSelected

listBoxRowIsSelected Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> m Bool | Returns: `True` if `row` is selected

Returns whether the child is currently selected in its `GtkListBox` container.

## new

listBoxRowNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m ListBoxRow | Returns: a new `GtkListBoxRow`

Creates a new `GtkListBoxRow`.

## setActivatable

listBoxRowSetActivatable Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> Bool | `activatable`: `True` to mark the row as activatable
-> m () |

Set whether the row is activatable.

## setChild

listBoxRowSetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a, IsWidget b) |
=> a | `row`: a `GtkListBoxRow`
-> Maybe b | `child`: the child widget
-> m () |

Sets the child widget of `self`.

## setHeader

listBoxRowSetHeader Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a, IsWidget b) |
=> a | `row`: a `GtkListBoxRow`
-> Maybe b | `header`: the header
-> m () |

Sets the current header of the `row`.

This is only allowed to be called from a [callback`gtk`.ListBoxUpdateHeaderFunc]. It will replace any existing header in the row, and be shown in front of the row in the listbox.

## setSelectable

listBoxRowSetSelectable Source #

Arguments

:: (HasCallStack, MonadIO m, IsListBoxRow a) |
=> a | `row`: a `GtkListBoxRow`
-> Bool | `selectable`: `True` to mark the row as selectable
-> m () |

Set whether the row can be selected.

# Properties

## activatable

Determines whether the rowActivated signal will be emitted for this row.

constructListBoxRowActivatable :: (IsListBoxRow o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getListBoxRowActivatable :: (MonadIO m, IsListBoxRow o) => o -> m Bool Source #

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

    get listBoxRow #activatable

setListBoxRowActivatable :: (MonadIO m, IsListBoxRow o) => o -> Bool -> m () Source #

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

    set listBoxRow [ #activatable := value ]

## child

The child widget.

clearListBoxRowChild :: (MonadIO m, IsListBoxRow o) => o -> m () Source #

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

    clear #child

constructListBoxRowChild :: (IsListBoxRow 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`.

getListBoxRowChild :: (MonadIO m, IsListBoxRow o) => o -> m (Maybe Widget) Source #

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

    get listBoxRow #child

setListBoxRowChild :: (MonadIO m, IsListBoxRow o, IsWidget a) => o -> a -> m () Source #

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

    set listBoxRow [ #child := value ]

## selectable

Determines whether this row can be selected.

constructListBoxRowSelectable :: (IsListBoxRow o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getListBoxRowSelectable :: (MonadIO m, IsListBoxRow o) => o -> m Bool Source #

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

    get listBoxRow #selectable

setListBoxRowSelectable :: (MonadIO m, IsListBoxRow o) => o -> Bool -> m () Source #

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

    set listBoxRow [ #selectable := value ]

# Signals

## activate

type ListBoxRowActivateCallback = IO () Source #

This is a keybinding signal, which will cause this row to be activated.

If you want to be notified when the user activates a row (by key or not), use the ListBox::rowActivated signal on the row’s parent `GtkListBox`.

afterListBoxRowActivate :: (IsListBoxRow a, MonadIO m) => a -> ((?self :: a) => ListBoxRowActivateCallback) -> 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 listBoxRow #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.

onListBoxRowActivate :: (IsListBoxRow a, MonadIO m) => a -> ((?self :: a) => ListBoxRowActivateCallback) -> 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 listBoxRow #activate callback