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 |
GI.Gtk.Objects.ListItem
Contents
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:
- 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
. - The bound stage where the listitem references an item from the list.
The ListItem:item property is not
Nothing
.
Synopsis
- newtype ListItem = ListItem (ManagedPtr ListItem)
- class (GObject o, IsDescendantOf ListItem o) => IsListItem o
- toListItem :: (MonadIO m, IsListItem o) => o -> m ListItem
- listItemGetAccessibleDescription :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Text
- listItemGetAccessibleLabel :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Text
- listItemGetActivatable :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Bool
- listItemGetChild :: (HasCallStack, MonadIO m, IsListItem a) => a -> m (Maybe Widget)
- listItemGetFocusable :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Bool
- listItemGetItem :: (HasCallStack, MonadIO m, IsListItem a) => a -> m (Maybe Object)
- listItemGetPosition :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Word32
- listItemGetSelectable :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Bool
- listItemGetSelected :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Bool
- listItemSetAccessibleDescription :: (HasCallStack, MonadIO m, IsListItem a) => a -> Text -> m ()
- listItemSetAccessibleLabel :: (HasCallStack, MonadIO m, IsListItem a) => a -> Text -> m ()
- listItemSetActivatable :: (HasCallStack, MonadIO m, IsListItem a) => a -> Bool -> m ()
- listItemSetChild :: (HasCallStack, MonadIO m, IsListItem a, IsWidget b) => a -> Maybe b -> m ()
- listItemSetFocusable :: (HasCallStack, MonadIO m, IsListItem a) => a -> Bool -> m ()
- listItemSetSelectable :: (HasCallStack, MonadIO m, IsListItem a) => a -> Bool -> m ()
- constructListItemAccessibleDescription :: (IsListItem o, MonadIO m) => Text -> m (GValueConstruct o)
- getListItemAccessibleDescription :: (MonadIO m, IsListItem o) => o -> m Text
- setListItemAccessibleDescription :: (MonadIO m, IsListItem o) => o -> Text -> m ()
- constructListItemAccessibleLabel :: (IsListItem o, MonadIO m) => Text -> m (GValueConstruct o)
- getListItemAccessibleLabel :: (MonadIO m, IsListItem o) => o -> m Text
- setListItemAccessibleLabel :: (MonadIO m, IsListItem o) => o -> Text -> m ()
- constructListItemActivatable :: (IsListItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getListItemActivatable :: (MonadIO m, IsListItem o) => o -> m Bool
- setListItemActivatable :: (MonadIO m, IsListItem o) => o -> Bool -> m ()
- clearListItemChild :: (MonadIO m, IsListItem o) => o -> m ()
- constructListItemChild :: (IsListItem o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getListItemChild :: (MonadIO m, IsListItem o) => o -> m (Maybe Widget)
- setListItemChild :: (MonadIO m, IsListItem o, IsWidget a) => o -> a -> m ()
- constructListItemFocusable :: (IsListItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getListItemFocusable :: (MonadIO m, IsListItem o) => o -> m Bool
- setListItemFocusable :: (MonadIO m, IsListItem o) => o -> Bool -> m ()
- getListItemItem :: (MonadIO m, IsListItem o) => o -> m (Maybe Object)
- getListItemPosition :: (MonadIO m, IsListItem o) => o -> m Word32
- constructListItemSelectable :: (IsListItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getListItemSelectable :: (MonadIO m, IsListItem o) => o -> m Bool
- setListItemSelectable :: (MonadIO m, IsListItem o) => o -> Bool -> m ()
- getListItemSelected :: (MonadIO m, IsListItem o) => o -> m Bool
Exported types
Memory-managed wrapper type.
Instances
Eq ListItem Source # | |
GObject ListItem Source # | |
Defined in GI.Gtk.Objects.ListItem | |
ManagedPtrNewtype ListItem Source # | |
Defined in GI.Gtk.Objects.ListItem Methods toManagedPtr :: ListItem -> ManagedPtr ListItem | |
TypedObject ListItem Source # | |
Defined in GI.Gtk.Objects.ListItem | |
HasParentTypes ListItem Source # | |
Defined in GI.Gtk.Objects.ListItem | |
IsGValue (Maybe ListItem) Source # | Convert |
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 # | |
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
(GObject o, IsDescendantOf ListItem o) => IsListItem o Source # | |
Defined in GI.Gtk.Objects.ListItem |
toListItem :: (MonadIO m, IsListItem o) => o -> m ListItem Source #
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAccessibleDescription, getAccessibleLabel, getActivatable, getChild, getData, getFocusable, getItem, getPosition, getProperty, getQdata, getSelectable, getSelected.
Setters
setAccessibleDescription, setAccessibleLabel, setActivatable, setChild, setData, setDataFull, setFocusable, setProperty, setSelectable.
getAccessibleDescription
listItemGetAccessibleDescription Source #
Arguments
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> 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 |
|
-> 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 |
|
-> m Bool | Returns: |
Checks if a list item has been set to be activatable via
listItemSetActivatable
.
getChild
Arguments
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> m (Maybe Widget) | Returns: The child |
Gets the child previously set via listItemSetChild
or
Nothing
if none was set.
getFocusable
Arguments
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> m Bool | Returns: |
Checks if a list item has been set to be focusable via
listItemSetFocusable
.
Since: 4.12
getItem
Arguments
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> m (Maybe Object) | Returns: The item displayed |
Gets the model item that associated with self
.
If self
is unbound, this function returns Nothing
.
getPosition
Arguments
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> 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 |
|
-> m Bool | Returns: |
Checks if a list item has been set to be selectable via
listItemSetSelectable
.
Do not confuse this function with listItemGetSelected
.
getSelected
Arguments
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> m Bool | Returns: |
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 |
|
-> Text |
|
-> 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 |
|
-> Text |
|
-> 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 |
|
-> Bool |
|
-> 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
Arguments
:: (HasCallStack, MonadIO m, IsListItem a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> 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
Arguments
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> Bool |
|
-> 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 |
|
-> Bool |
|
-> 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