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 |
GtkTreeListModel
is a list model that can create child models on demand.
Synopsis
- newtype TreeListModel = TreeListModel (ManagedPtr TreeListModel)
- class (GObject o, IsDescendantOf TreeListModel o) => IsTreeListModel o
- toTreeListModel :: (MonadIO m, IsTreeListModel o) => o -> m TreeListModel
- treeListModelGetAutoexpand :: (HasCallStack, MonadIO m, IsTreeListModel a) => a -> m Bool
- treeListModelGetChildRow :: (HasCallStack, MonadIO m, IsTreeListModel a) => a -> Word32 -> m (Maybe TreeListRow)
- treeListModelGetModel :: (HasCallStack, MonadIO m, IsTreeListModel a) => a -> m ListModel
- treeListModelGetPassthrough :: (HasCallStack, MonadIO m, IsTreeListModel a) => a -> m Bool
- treeListModelGetRow :: (HasCallStack, MonadIO m, IsTreeListModel a) => a -> Word32 -> m (Maybe TreeListRow)
- treeListModelNew :: (HasCallStack, MonadIO m, IsListModel a) => a -> Bool -> Bool -> TreeListModelCreateModelFunc -> m TreeListModel
- treeListModelSetAutoexpand :: (HasCallStack, MonadIO m, IsTreeListModel a) => a -> Bool -> m ()
- constructTreeListModelAutoexpand :: (IsTreeListModel o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTreeListModelAutoexpand :: (MonadIO m, IsTreeListModel o) => o -> m Bool
- setTreeListModelAutoexpand :: (MonadIO m, IsTreeListModel o) => o -> Bool -> m ()
- getTreeListModelItemType :: (MonadIO m, IsTreeListModel o) => o -> m GType
- getTreeListModelModel :: (MonadIO m, IsTreeListModel o) => o -> m ListModel
- getTreeListModelNItems :: (MonadIO m, IsTreeListModel o) => o -> m Word32
- constructTreeListModelPassthrough :: (IsTreeListModel o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTreeListModelPassthrough :: (MonadIO m, IsTreeListModel o) => o -> m Bool
Exported types
newtype TreeListModel Source #
Memory-managed wrapper type.
TreeListModel (ManagedPtr TreeListModel) |
Instances
Eq TreeListModel Source # | |
Defined in GI.Gtk.Objects.TreeListModel (==) :: TreeListModel -> TreeListModel -> Bool # (/=) :: TreeListModel -> TreeListModel -> Bool # | |
GObject TreeListModel Source # | |
Defined in GI.Gtk.Objects.TreeListModel | |
ManagedPtrNewtype TreeListModel Source # | |
Defined in GI.Gtk.Objects.TreeListModel toManagedPtr :: TreeListModel -> ManagedPtr TreeListModel | |
TypedObject TreeListModel Source # | |
Defined in GI.Gtk.Objects.TreeListModel | |
HasParentTypes TreeListModel Source # | |
Defined in GI.Gtk.Objects.TreeListModel | |
IsGValue (Maybe TreeListModel) Source # | Convert |
Defined in GI.Gtk.Objects.TreeListModel gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TreeListModel -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TreeListModel) | |
type ParentTypes TreeListModel Source # | |
Defined in GI.Gtk.Objects.TreeListModel type ParentTypes TreeListModel = '[Object, ListModel] |
class (GObject o, IsDescendantOf TreeListModel o) => IsTreeListModel o Source #
Type class for types which can be safely cast to TreeListModel
, for instance with toTreeListModel
.
Instances
(GObject o, IsDescendantOf TreeListModel o) => IsTreeListModel o Source # | |
Defined in GI.Gtk.Objects.TreeListModel |
toTreeListModel :: (MonadIO m, IsTreeListModel o) => o -> m TreeListModel Source #
Cast to TreeListModel
, 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
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, itemsChanged, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAutoexpand, getChildRow, getData, getItem, getItemType, getModel, getNItems, getPassthrough, getProperty, getQdata, getRow.
Setters
getAutoexpand
treeListModelGetAutoexpand Source #
:: (HasCallStack, MonadIO m, IsTreeListModel a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether the model is set to automatically expand new rows that get added.
This can be either rows added by changes to the underlying
models or via treeListRowSetExpanded
.
getChildRow
treeListModelGetChildRow Source #
:: (HasCallStack, MonadIO m, IsTreeListModel a) | |
=> a |
|
-> Word32 |
|
-> m (Maybe TreeListRow) | Returns: the child in |
Gets the row item corresponding to the child at index position
for
self
's root model.
If position
is greater than the number of children in the root model,
Nothing
is returned.
Do not confuse this function with treeListModelGetRow
.
getModel
treeListModelGetModel Source #
:: (HasCallStack, MonadIO m, IsTreeListModel a) | |
=> a |
|
-> m ListModel | Returns: the root model |
Gets the root model that self
was created with.
getPassthrough
treeListModelGetPassthrough Source #
:: (HasCallStack, MonadIO m, IsTreeListModel a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether the model is passing through original row items.
If this function returns False
, the GListModel
functions for self
return custom GtkTreeListRow
objects. You need to call
treeListRowGetItem
on these objects to get the original
item.
If True
, the values of the child models are passed through in their
original state. You then need to call treeListModelGetRow
to get the custom GtkTreeListRow
s.
getRow
:: (HasCallStack, MonadIO m, IsTreeListModel a) | |
=> a |
|
-> Word32 |
|
-> m (Maybe TreeListRow) | Returns: The row item |
Gets the row object for the given row.
If position
is greater than the number of items in self
,
Nothing
is returned.
The row object can be used to expand and collapse rows as well as to inspect its position in the tree. See its documentation for details.
This row object is persistent and will refer to the current
item as long as the row is present in self
, independent of
other rows being added or removed.
If self
is set to not be passthrough, this function is
equivalent to calling g_list_model_get_item()
.
Do not confuse this function with treeListModelGetChildRow
.
new
:: (HasCallStack, MonadIO m, IsListModel a) | |
=> a |
|
-> Bool |
|
-> Bool |
|
-> TreeListModelCreateModelFunc |
|
-> m TreeListModel | Returns: a newly created |
Creates a new empty GtkTreeListModel
displaying root
with all rows collapsed.
setAutoexpand
treeListModelSetAutoexpand Source #
:: (HasCallStack, MonadIO m, IsTreeListModel a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the model should autoexpand.
If set to True
, the model will recursively expand all rows that
get added to the model. This can be either rows added by changes
to the underlying models or via treeListRowSetExpanded
.
Properties
autoexpand
If all rows should be expanded by default.
constructTreeListModelAutoexpand :: (IsTreeListModel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “autoexpand
” property. This is rarely needed directly, but it is used by new
.
getTreeListModelAutoexpand :: (MonadIO m, IsTreeListModel o) => o -> m Bool Source #
Get the value of the “autoexpand
” property.
When overloading is enabled, this is equivalent to
get
treeListModel #autoexpand
setTreeListModelAutoexpand :: (MonadIO m, IsTreeListModel o) => o -> Bool -> m () Source #
Set the value of the “autoexpand
” property.
When overloading is enabled, this is equivalent to
set
treeListModel [ #autoexpand:=
value ]
itemType
The type of items. See listModelGetItemType
.
Since: 4.8
getTreeListModelItemType :: (MonadIO m, IsTreeListModel o) => o -> m GType Source #
Get the value of the “item-type
” property.
When overloading is enabled, this is equivalent to
get
treeListModel #itemType
model
The root model displayed.
getTreeListModelModel :: (MonadIO m, IsTreeListModel o) => o -> m ListModel Source #
Get the value of the “model
” property.
When overloading is enabled, this is equivalent to
get
treeListModel #model
nItems
The number of items. See listModelGetNItems
.
Since: 4.8
getTreeListModelNItems :: (MonadIO m, IsTreeListModel o) => o -> m Word32 Source #
Get the value of the “n-items
” property.
When overloading is enabled, this is equivalent to
get
treeListModel #nItems
passthrough
Gets whether the model is in passthrough mode.
If False
, the GListModel
functions for this object return custom
TreeListRow
objects. If True
, the values of the child
models are pass through unmodified.
constructTreeListModelPassthrough :: (IsTreeListModel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “passthrough
” property. This is rarely needed directly, but it is used by new
.
getTreeListModelPassthrough :: (MonadIO m, IsTreeListModel o) => o -> m Bool Source #
Get the value of the “passthrough
” property.
When overloading is enabled, this is equivalent to
get
treeListModel #passthrough