gi-gtk-4.0.9: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.ListItem

Description

GtkListItem is used by list widgets to represent items in a ListModel.

GtkListItem objects are managed by the list widget (with its factory) and cannot be created by applications, but they need to be populated by application code. This is done by calling listItemSetChild.

GtkListItem objects exist in 2 stages:

  1. The unbound stage where the listitem is not currently connected to an item in the list. In that case, the ListItem:item property is set to Nothing.
  2. The bound stage where the listitem references an item from the list. The ListItem:item property is not Nothing.
Synopsis

Exported types

newtype ListItem Source #

Memory-managed wrapper type.

Constructors

ListItem (ManagedPtr ListItem) 

Instances

Instances details
Eq ListItem Source # 
Instance details

Defined in GI.Gtk.Objects.ListItem

GObject ListItem Source # 
Instance details

Defined in GI.Gtk.Objects.ListItem

ManagedPtrNewtype ListItem Source # 
Instance details

Defined in GI.Gtk.Objects.ListItem

Methods

toManagedPtr :: ListItem -> ManagedPtr ListItem

TypedObject ListItem Source # 
Instance details

Defined in GI.Gtk.Objects.ListItem

Methods

glibType :: IO GType

HasParentTypes ListItem Source # 
Instance details

Defined in GI.Gtk.Objects.ListItem

IsGValue (Maybe ListItem) Source #

Convert ListItem to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.ListItem

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ListItem -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ListItem)

type ParentTypes ListItem Source # 
Instance details

Defined in GI.Gtk.Objects.ListItem

type ParentTypes ListItem = '[Object]

class (GObject o, IsDescendantOf ListItem o) => IsListItem o Source #

Type class for types which can be safely cast to ListItem, for instance with toListItem.

Instances

Instances details
(GObject o, IsDescendantOf ListItem o) => IsListItem o Source # 
Instance details

Defined in GI.Gtk.Objects.ListItem

toListItem :: (MonadIO m, IsListItem o) => o -> m ListItem Source #

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

Methods

getAccessibleDescription

listItemGetAccessibleDescription Source #

Arguments

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

self: a GtkListItem

-> m Text

Returns: the accessible description

Gets the accessible description of self.

Since: 4.12

getAccessibleLabel

listItemGetAccessibleLabel Source #

Arguments

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

self: a GtkListItem

-> m Text

Returns: the accessible label

Gets the accessible label of self.

Since: 4.12

getActivatable

listItemGetActivatable Source #

Arguments

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

self: a GtkListItem

-> m Bool

Returns: True if the item is activatable

Checks if a list item has been set to be activatable via listItemSetActivatable.

getChild

listItemGetChild Source #

Arguments

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

self: a GtkListItem

-> m (Maybe Widget)

Returns: The child

Gets the child previously set via listItemSetChild or Nothing if none was set.

getFocusable

listItemGetFocusable Source #

Arguments

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

self: a GtkListItem

-> m Bool

Returns: True if the item is focusable

Checks if a list item has been set to be focusable via listItemSetFocusable.

Since: 4.12

getItem

listItemGetItem Source #

Arguments

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

self: a GtkListItem

-> m (Maybe Object)

Returns: The item displayed

Gets the model item that associated with self.

If self is unbound, this function returns Nothing.

getPosition

listItemGetPosition Source #

Arguments

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

self: a GtkListItem

-> m Word32

Returns: The position of this item

Gets the position in the model that self currently displays.

If self is unbound, INVALID_LIST_POSITION is returned.

getSelectable

listItemGetSelectable Source #

Arguments

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

self: a GtkListItem

-> m Bool

Returns: True if the item is selectable

Checks if a list item has been set to be selectable via listItemSetSelectable.

Do not confuse this function with listItemGetSelected.

getSelected

listItemGetSelected Source #

Arguments

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

self: a GtkListItem

-> m Bool

Returns: True if the item is selected.

Checks if the item is displayed as selected.

The selected state is maintained by the liste widget and its model and cannot be set otherwise.

setAccessibleDescription

listItemSetAccessibleDescription Source #

Arguments

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

self: a GtkListItem

-> Text

description: the description

-> m () 

Sets the accessible description for the list item, which may be used by e.g. screen readers.

Since: 4.12

setAccessibleLabel

listItemSetAccessibleLabel Source #

Arguments

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

self: a GtkListItem

-> Text

label: the label

-> m () 

Sets the accessible label for the list item, which may be used by e.g. screen readers.

Since: 4.12

setActivatable

listItemSetActivatable Source #

Arguments

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

self: a GtkListItem

-> Bool

activatable: if the item should be activatable

-> m () 

Sets self to be activatable.

If an item is activatable, double-clicking on the item, using the Return key or calling widgetActivate will activate the item. Activating instructs the containing view to handle activation. GtkListView for example will be emitting the ListView::activate signal.

By default, list items are activatable.

setChild

listItemSetChild Source #

Arguments

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

self: a GtkListItem

-> Maybe b

child: The list item's child or Nothing to unset

-> m () 

Sets the child to be used for this listitem.

This function is typically called by applications when setting up a listitem so that the widget can be reused when binding it multiple times.

setFocusable

listItemSetFocusable Source #

Arguments

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

self: a GtkListItem

-> Bool

focusable: if the item should be focusable

-> m () 

Sets self to be focusable.

If an item is focusable, it can be focused using the keyboard. This works similar to widgetSetFocusable.

Note that if items are not focusable, the keyboard cannot be used to activate them and selecting only works if one of the listitem's children is focusable.

By default, list items are focusable.

Since: 4.12

setSelectable

listItemSetSelectable Source #

Arguments

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

self: a GtkListItem

-> Bool

selectable: if the item should be selectable

-> m () 

Sets self to be selectable.

If an item is selectable, clicking on the item or using the keyboard will try to select or unselect the item. If this succeeds is up to the model to determine, as it is managing the selected state.

Note that this means that making an item non-selectable has no influence on the selected state at all. A non-selectable item may still be selected.

By default, list items are selectable. When rebinding them to a new item, they will also be reset to be selectable by GTK.

Properties

accessibleDescription

The accessible description to set on the list item.

Since: 4.12

constructListItemAccessibleDescription :: (IsListItem o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getListItemAccessibleDescription :: (MonadIO m, IsListItem o) => o -> m Text Source #

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

get listItem #accessibleDescription

setListItemAccessibleDescription :: (MonadIO m, IsListItem o) => o -> Text -> m () Source #

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

set listItem [ #accessibleDescription := value ]

accessibleLabel

The accessible label to set on the list item.

Since: 4.12

constructListItemAccessibleLabel :: (IsListItem o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getListItemAccessibleLabel :: (MonadIO m, IsListItem o) => o -> m Text Source #

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

get listItem #accessibleLabel

setListItemAccessibleLabel :: (MonadIO m, IsListItem o) => o -> Text -> m () Source #

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

set listItem [ #accessibleLabel := value ]

activatable

If the item can be activated by the user.

constructListItemActivatable :: (IsListItem 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.

getListItemActivatable :: (MonadIO m, IsListItem o) => o -> m Bool Source #

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

get listItem #activatable

setListItemActivatable :: (MonadIO m, IsListItem o) => o -> Bool -> m () Source #

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

set listItem [ #activatable := value ]

child

Widget used for display.

clearListItemChild :: (MonadIO m, IsListItem o) => o -> m () Source #

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

clear #child

constructListItemChild :: (IsListItem 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.

getListItemChild :: (MonadIO m, IsListItem o) => o -> m (Maybe Widget) Source #

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

get listItem #child

setListItemChild :: (MonadIO m, IsListItem o, IsWidget a) => o -> a -> m () Source #

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

set listItem [ #child := value ]

focusable

If the item can be focused with the keyboard.

Since: 4.12

constructListItemFocusable :: (IsListItem o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getListItemFocusable :: (MonadIO m, IsListItem o) => o -> m Bool Source #

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

get listItem #focusable

setListItemFocusable :: (MonadIO m, IsListItem o) => o -> Bool -> m () Source #

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

set listItem [ #focusable := value ]

item

Displayed item.

getListItemItem :: (MonadIO m, IsListItem o) => o -> m (Maybe Object) Source #

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

get listItem #item

position

Position of the item.

getListItemPosition :: (MonadIO m, IsListItem o) => o -> m Word32 Source #

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

get listItem #position

selectable

If the item can be selected by the user.

constructListItemSelectable :: (IsListItem 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.

getListItemSelectable :: (MonadIO m, IsListItem o) => o -> m Bool Source #

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

get listItem #selectable

setListItemSelectable :: (MonadIO m, IsListItem o) => o -> Bool -> m () Source #

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

set listItem [ #selectable := value ]

selected

If the item is currently selected.

getListItemSelected :: (MonadIO m, IsListItem o) => o -> m Bool Source #

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

get listItem #selected