gi-gtk-4.0.6: 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 GListModel.

The GtkListItems 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.

GtkListItems 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

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.

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.

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.

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

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 ]

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