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 |
GtkListItem
is used by list widgets to represent items in a GListModel
.
The GtkListItem
s 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
s 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
- listItemGetActivatable :: (HasCallStack, MonadIO m, IsListItem a) => a -> m Bool
- listItemGetChild :: (HasCallStack, MonadIO m, IsListItem a) => a -> m (Maybe Widget)
- 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
- listItemSetActivatable :: (HasCallStack, MonadIO m, IsListItem a) => a -> Bool -> m ()
- listItemSetChild :: (HasCallStack, MonadIO m, IsListItem a, IsWidget b) => a -> Maybe b -> m ()
- listItemSetSelectable :: (HasCallStack, MonadIO m, IsListItem a) => a -> Bool -> 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 ()
- 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 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 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
getActivatable, getChild, getData, getItem, getPosition, getProperty, getQdata, getSelectable, getSelected.
Setters
setActivatable, setChild, setData, setDataFull, setProperty, setSelectable.
getActivatable
listItemGetActivatable Source #
:: (HasCallStack, MonadIO m, IsListItem a) | |
=> a |
|
-> m Bool | Returns: |
Checks if a list item has been set to be activatable via
listItemSetActivatable
.
getChild
:: (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.
getItem
:: (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
:: (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 #
:: (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
:: (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.
setActivatable
listItemSetActivatable Source #
:: (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
:: (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.
setSelectable
listItemSetSelectable Source #
:: (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
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