Stability | provisional |
---|---|
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell2010 |
The tree interface used by TreeView
.
Synopsis
- treeModelUnrefNode :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m ()
- treeModelSortNewWithModel :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> m TreeModel
- treeModelRowsReordered :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreePath -> Maybe TreeIter -> [Int32] -> m ()
- treeModelRowInserted :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreePath -> TreeIter -> m ()
- treeModelRowHasChildToggled :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreePath -> TreeIter -> m ()
- treeModelRowDeleted :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreePath -> m ()
- treeModelRowChanged :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreePath -> TreeIter -> m ()
- treeModelRefNode :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m ()
- treeModelIterPrevious :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m Bool
- treeModelIterParent :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m (Bool, TreeIter)
- treeModelIterNthChild :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> Maybe TreeIter -> Int32 -> m (Bool, TreeIter)
- treeModelIterNext :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m Bool
- treeModelIterNChildren :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> Maybe TreeIter -> m Int32
- treeModelIterHasChild :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m Bool
- treeModelIterChildren :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> Maybe TreeIter -> m (Bool, TreeIter)
- treeModelGetStringFromIter :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m Text
- treeModelGetPath :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeIter -> m TreePath
- treeModelGetNColumns :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> m Int32
- treeModelGetIterFromString :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> Text -> m (Bool, TreeIter)
- treeModelGetIterFirst :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> m (Bool, TreeIter)
- treeModelGetFlags :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> m [TreeModelFlags]
- treeModelGetColumnType :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> Int32 -> m GType
- treeModelForeach :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> TreeModelForeachFunc -> m ()
- treeModelFilterNew :: (HasCallStack, MonadIO m, IsTreeModel a) => a -> Maybe TreePath -> m TreeModel
- toTreeModel :: (MonadIO m, IsTreeModel o) => o -> m TreeModel
- afterTreeModelRowInserted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowInsertedCallback -> m SignalHandlerId
- onTreeModelRowInserted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowInsertedCallback -> m SignalHandlerId
- wrap_TreeModelRowInsertedCallback :: TreeModelRowInsertedCallback -> C_TreeModelRowInsertedCallback
- genClosure_TreeModelRowInserted :: MonadIO m => TreeModelRowInsertedCallback -> m (GClosure C_TreeModelRowInsertedCallback)
- noTreeModelRowInsertedCallback :: Maybe TreeModelRowInsertedCallback
- afterTreeModelRowHasChildToggled :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowHasChildToggledCallback -> m SignalHandlerId
- onTreeModelRowHasChildToggled :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowHasChildToggledCallback -> m SignalHandlerId
- wrap_TreeModelRowHasChildToggledCallback :: TreeModelRowHasChildToggledCallback -> C_TreeModelRowHasChildToggledCallback
- genClosure_TreeModelRowHasChildToggled :: MonadIO m => TreeModelRowHasChildToggledCallback -> m (GClosure C_TreeModelRowHasChildToggledCallback)
- noTreeModelRowHasChildToggledCallback :: Maybe TreeModelRowHasChildToggledCallback
- afterTreeModelRowDeleted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowDeletedCallback -> m SignalHandlerId
- onTreeModelRowDeleted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowDeletedCallback -> m SignalHandlerId
- wrap_TreeModelRowDeletedCallback :: TreeModelRowDeletedCallback -> C_TreeModelRowDeletedCallback
- genClosure_TreeModelRowDeleted :: MonadIO m => TreeModelRowDeletedCallback -> m (GClosure C_TreeModelRowDeletedCallback)
- noTreeModelRowDeletedCallback :: Maybe TreeModelRowDeletedCallback
- afterTreeModelRowChanged :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowChangedCallback -> m SignalHandlerId
- onTreeModelRowChanged :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowChangedCallback -> m SignalHandlerId
- wrap_TreeModelRowChangedCallback :: TreeModelRowChangedCallback -> C_TreeModelRowChangedCallback
- genClosure_TreeModelRowChanged :: MonadIO m => TreeModelRowChangedCallback -> m (GClosure C_TreeModelRowChangedCallback)
- noTreeModelRowChangedCallback :: Maybe TreeModelRowChangedCallback
- noTreeModel :: Maybe TreeModel
- mk_TreeModelRowChangedCallback :: C_TreeModelRowChangedCallback -> IO (FunPtr C_TreeModelRowChangedCallback)
- mk_TreeModelRowDeletedCallback :: C_TreeModelRowDeletedCallback -> IO (FunPtr C_TreeModelRowDeletedCallback)
- mk_TreeModelRowHasChildToggledCallback :: C_TreeModelRowHasChildToggledCallback -> IO (FunPtr C_TreeModelRowHasChildToggledCallback)
- mk_TreeModelRowInsertedCallback :: C_TreeModelRowInsertedCallback -> IO (FunPtr C_TreeModelRowInsertedCallback)
- type TreeModelRowChangedCallback = TreePath -> TreeIter -> IO ()
- type C_TreeModelRowChangedCallback = Ptr () -> Ptr TreePath -> Ptr TreeIter -> Ptr () -> IO ()
- type TreeModelRowDeletedCallback = TreePath -> IO ()
- type C_TreeModelRowDeletedCallback = Ptr () -> Ptr TreePath -> Ptr () -> IO ()
- type TreeModelRowHasChildToggledCallback = TreePath -> TreeIter -> IO ()
- type C_TreeModelRowHasChildToggledCallback = Ptr () -> Ptr TreePath -> Ptr TreeIter -> Ptr () -> IO ()
- type TreeModelRowInsertedCallback = TreePath -> TreeIter -> IO ()
- type C_TreeModelRowInsertedCallback = Ptr () -> Ptr TreePath -> Ptr TreeIter -> Ptr () -> IO ()
- newtype TreeModel = TreeModel (ManagedPtr TreeModel)
- class (GObject o, IsDescendantOf TreeModel o) => IsTreeModel o
- data TreeModelFilterNewMethodInfo
- data TreeModelForeachMethodInfo
- data TreeModelGetColumnTypeMethodInfo
- data TreeModelGetFlagsMethodInfo
- data TreeModelGetIterFirstMethodInfo
- data TreeModelGetIterFromStringMethodInfo
- data TreeModelGetIterMethodInfo
- data TreeModelGetNColumnsMethodInfo
- data TreeModelGetPathMethodInfo
- data TreeModelGetStringFromIterMethodInfo
- data TreeModelGetValueMethodInfo
- data TreeModelIterChildrenMethodInfo
- data TreeModelIterHasChildMethodInfo
- data TreeModelIterNChildrenMethodInfo
- data TreeModelIterNextMethodInfo
- data TreeModelIterNthChildMethodInfo
- data TreeModelIterParentMethodInfo
- data TreeModelIterPreviousMethodInfo
- data TreeModelRefNodeMethodInfo
- data TreeModelRowChangedMethodInfo
- data TreeModelRowChangedSignalInfo
- data TreeModelRowDeletedMethodInfo
- data TreeModelRowDeletedSignalInfo
- data TreeModelRowHasChildToggledMethodInfo
- data TreeModelRowHasChildToggledSignalInfo
- data TreeModelRowInsertedMethodInfo
- data TreeModelRowInsertedSignalInfo
- data TreeModelRowsReorderedMethodInfo
- data TreeModelSortNewWithModelMethodInfo
- data TreeModelUnrefNodeMethodInfo
- data ColumnId row ty
- makeColumnIdInt :: Int32 -> ColumnId row Int32
- makeColumnIdBool :: Int32 -> ColumnId row Bool
- makeColumnIdString :: Int32 -> ColumnId row Text
- makeColumnIdPixbuf :: Int32 -> ColumnId row Pixbuf
- invalidColumnId :: ColumnId row ty
- columnIdToNumber :: ColumnId row ty -> Int32
- stringToTreePath :: Text -> [Int32]
- treeModelGetValue :: IsTreeModel self => self -> TreeIter -> ColumnId row ty -> IO ty
- treeModelGetIter :: (MonadIO m, IsTreeModel model) => model -> TreePath -> m (Maybe TreeIter)
Detail
The TreeModel
interface defines a generic storage object for use by the
TreeView
and similar widgets. Specifically, the functions in defined here
are used by Gtk's widgets to access the stored data. Thus, rather than
calling these functions, an application programmer has to implement them.
While the module Data.GI.Gtk.ModelView.CustomStore provides the
necessary functions to implement the TreeMode
interface, it is often
sufficient to use the wo implementations that come with gi-gtk-hs, namely are
ListStore
and TreeStore
.
The model is represented as a hierarchical tree of values. It is important to note that this interface only provides a way of examining a model and observing changes. The implementation of each individual model decides how and if changes are made.
Two generic models are provided that implement the TreeModel
interface:
the TreeStore
and the ListStore
. To use these, the developer simply
inserts data into these models as necessary. These models provide the data
structure as well as the TreeModel
interface. In fact, they implement
other interfaces, making drag and drop and storing data trivial.
A TreeModel
stores records of the same type. Each record is referred to
as row, just like in a relational database. Defining how the information of
a row is displayed can be done in two ways: If the widget displays data
using CellRenderer
or one of its
derivatives, it is possible to state how a row is mapped to the attributes
of a renderer using the
cellLayoutSetAttributes
function.
Some widgets do not use
CellRenderer
s to display their
data. In this case an extraction function can be defined that maps a row to
one of a few basic types (like String
s or Int
s). This extraction
function is associated with a ColumnId
using
treeModelSetColumn
. The latter can
be set in the widget for the property that should be set. The widget then
uses the function treeModelGetValue
and the ColumnId
to extract the
value from the model. As the name suggests, using ColumnId
s creates a
view of the data as if each row were divided into a well-defined set of
columns, again, like a relational database.
Models are accessed on a node level of granularity. There are two index
types used to reference a particular node in a model. They are the
TreePath
and the TreeIter
. Most of the interface consists of operations
on a TreeIter
.
A path is essentially a potential node. It is a location on a model that
may or may not actually correspond to a node on a specific model. A
TreePath
is in fact a synonym for a list of Int
s and hence are easy to
manipulate. Each number refers to the offset at that level. Thus, the path
[0]
refers to the root node and the path [2,4]
refers to the fifth
child of the third node.
By contrast, a TreeIter
is a reference to a specific node on a specific
model. It is an abstract data type filled in by the model. One can convert
a path to an iterator by calling treeModelGetIter
. These iterators are
the primary way of accessing a model and are similar to the iterators used
by TextBuffer
. The model interface defines a set of operations using them
for navigating the model. Iterators are expected to always be valid for as
long as the model is unchanged (and doesn't emit a signal).
Class Hierarchy
| GInterface | +----TreeModel | +--------TypedTreeModel
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m () |
Lets the tree unref the node.
This is an optional method for models to implement.
To be more specific, models may ignore this call as it exists
primarily for performance reasons. For more information on what
this means, see treeModelRefNode
.
Please note that nodes that are deleted are not unreffed.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> m TreeModel | Returns: A new |
Creates a new TreeModel
, with childModel
as the child model.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreePath |
|
-> Maybe TreeIter |
|
-> [Int32] |
|
-> m () |
Emits the TreeModel
::rows-reordered
signal on treeModel
.
This should be called by models when their rows have been reordered.
Since: 3.10
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreePath |
|
-> TreeIter |
|
-> m () |
Emits the TreeModel
::row-inserted
signal on treeModel
.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreePath |
|
-> TreeIter |
|
-> m () |
Emits the TreeModel
::row-has-child-toggled
signal on
treeModel
. This should be called by models after the child
state of a node changes.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreePath |
|
-> m () |
Emits the TreeModel
::row-deleted
signal on treeModel
.
This should be called by models after a row has been removed.
The location pointed to by path
should be the location that
the row previously was at. It may not be a valid location anymore.
Nodes that are deleted are not unreffed, this means that any outstanding references on the deleted node should not be released.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreePath |
|
-> TreeIter |
|
-> m () |
Emits the TreeModel
::row-changed
signal on treeModel
.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m () |
Lets the tree ref the node.
This is an optional method for models to implement. To be more specific, models may ignore this call as it exists primarily for performance reasons.
This function is primarily meant as a way for views to let caching models know when nodes are being displayed (and hence, whether or not to cache that node). Being displayed means a node is in an expanded branch, regardless of whether the node is currently visible in the viewport. For example, a file-system based model would not want to keep the entire file-hierarchy in memory, just the sections that are currently being displayed by every current view.
A model should be expected to be able to get an iter independent of its reffed state.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m Bool | Returns: |
Sets iter
to point to the previous node at the current level.
If there is no previous iter
, False
is returned and iter
is
set to be invalid.
Since: 3.0
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m (Bool, TreeIter) | Returns: |
Sets iter
to be the parent of child
.
If child
is at the toplevel, and doesn’t have a parent, then
iter
is set to an invalid iterator and False
is returned.
child
will remain a valid node after this function has been
called.
iter
will be initialized before the lookup is performed, so child
and iter
cannot point to the same memory location.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> Maybe TreeIter |
|
-> Int32 |
|
-> m (Bool, TreeIter) | Returns: |
Sets iter
to be the child of parent
, using the given index.
The first index is 0. If n
is too big, or parent
has no children,
iter
is set to an invalid iterator and False
is returned. parent
will remain a valid node after this function has been called. As a
special case, if parent
is Nothing
, then the n
-th root node
is set.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m Bool | Returns: |
Sets iter
to point to the node following it at the current level.
If there is no next iter
, False
is returned and iter
is set
to be invalid.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> Maybe TreeIter | |
-> m Int32 | Returns: the number of children of |
Returns the number of children that iter
has.
As a special case, if iter
is Nothing
, then the number
of toplevel nodes is returned.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m Bool | Returns: |
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> Maybe TreeIter | |
-> m (Bool, TreeIter) | Returns: |
Sets iter
to point to the first child of parent
.
If parent
has no children, False
is returned and iter
is
set to be invalid. parent
will remain a valid node after this
function has been called.
If parent
is Nothing
returns the first node, equivalent to
gtk_tree_model_get_iter_first (tree_model, iter);
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m Text | Returns: a newly-allocated string.
Must be freed with |
Generates a string representation of the iter.
This string is a “:” separated list of numbers. For example, “4:10:0:3” would be an acceptable return value for this string.
Since: 2.2
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeIter |
|
-> m TreePath | Returns: a newly-created |
Returns a newly-created TreePath
-struct referenced by iter
.
This path should be freed with treePathFree
.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> m Int32 | Returns: the number of columns |
Returns the number of columns supported by treeModel
.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> Text |
|
-> m (Bool, TreeIter) | Returns: |
Sets iter
to a valid iterator pointing to pathString
, if it
exists. Otherwise, iter
is left invalid and False
is returned.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> m (Bool, TreeIter) | Returns: |
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> m [TreeModelFlags] | Returns: the flags supported by this interface |
Returns a set of flags supported by this interface.
The flags are a bitwise combination of TreeModelFlags
.
The flags supported should not change during the lifetime
of the treeModel
.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> Int32 |
|
-> m GType | Returns: the type of the column |
Returns the type of the column.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> TreeModelForeachFunc |
|
-> m () |
Calls func on each node in model in a depth-first fashion.
If func
returns True
, then the tree ceases to be walked,
and treeModelForeach
returns.
:: (HasCallStack, MonadIO m, IsTreeModel a) | |
=> a |
|
-> Maybe TreePath | |
-> m TreeModel | Returns: A new |
Creates a new TreeModel
, with childModel
as the child_model
and root
as the virtual root.
Since: 2.4
toTreeModel :: (MonadIO m, IsTreeModel o) => o -> m TreeModel #
afterTreeModelRowInserted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowInsertedCallback -> m SignalHandlerId #
Connect a signal handler for the “row-inserted
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
treeModel #rowInserted callback
onTreeModelRowInserted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowInsertedCallback -> m SignalHandlerId #
Connect a signal handler for the “row-inserted
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
treeModel #rowInserted callback
wrap_TreeModelRowInsertedCallback :: TreeModelRowInsertedCallback -> C_TreeModelRowInsertedCallback #
Wrap a TreeModelRowInsertedCallback
into a C_TreeModelRowInsertedCallback
.
genClosure_TreeModelRowInserted :: MonadIO m => TreeModelRowInsertedCallback -> m (GClosure C_TreeModelRowInsertedCallback) #
Wrap the callback into a GClosure
.
noTreeModelRowInsertedCallback :: Maybe TreeModelRowInsertedCallback #
A convenience synonym for
.Nothing
:: Maybe
TreeModelRowInsertedCallback
afterTreeModelRowHasChildToggled :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowHasChildToggledCallback -> m SignalHandlerId #
Connect a signal handler for the “row-has-child-toggled
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
treeModel #rowHasChildToggled callback
onTreeModelRowHasChildToggled :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowHasChildToggledCallback -> m SignalHandlerId #
Connect a signal handler for the “row-has-child-toggled
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
treeModel #rowHasChildToggled callback
wrap_TreeModelRowHasChildToggledCallback :: TreeModelRowHasChildToggledCallback -> C_TreeModelRowHasChildToggledCallback #
genClosure_TreeModelRowHasChildToggled :: MonadIO m => TreeModelRowHasChildToggledCallback -> m (GClosure C_TreeModelRowHasChildToggledCallback) #
Wrap the callback into a GClosure
.
noTreeModelRowHasChildToggledCallback :: Maybe TreeModelRowHasChildToggledCallback #
A convenience synonym for
.Nothing
:: Maybe
TreeModelRowHasChildToggledCallback
afterTreeModelRowDeleted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowDeletedCallback -> m SignalHandlerId #
Connect a signal handler for the “row-deleted
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
treeModel #rowDeleted callback
onTreeModelRowDeleted :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowDeletedCallback -> m SignalHandlerId #
Connect a signal handler for the “row-deleted
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
treeModel #rowDeleted callback
wrap_TreeModelRowDeletedCallback :: TreeModelRowDeletedCallback -> C_TreeModelRowDeletedCallback #
Wrap a TreeModelRowDeletedCallback
into a C_TreeModelRowDeletedCallback
.
genClosure_TreeModelRowDeleted :: MonadIO m => TreeModelRowDeletedCallback -> m (GClosure C_TreeModelRowDeletedCallback) #
Wrap the callback into a GClosure
.
noTreeModelRowDeletedCallback :: Maybe TreeModelRowDeletedCallback #
A convenience synonym for
.Nothing
:: Maybe
TreeModelRowDeletedCallback
afterTreeModelRowChanged :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowChangedCallback -> m SignalHandlerId #
Connect a signal handler for the “row-changed
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
treeModel #rowChanged callback
onTreeModelRowChanged :: (IsTreeModel a, MonadIO m) => a -> TreeModelRowChangedCallback -> m SignalHandlerId #
Connect a signal handler for the “row-changed
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
treeModel #rowChanged callback
wrap_TreeModelRowChangedCallback :: TreeModelRowChangedCallback -> C_TreeModelRowChangedCallback #
Wrap a TreeModelRowChangedCallback
into a C_TreeModelRowChangedCallback
.
genClosure_TreeModelRowChanged :: MonadIO m => TreeModelRowChangedCallback -> m (GClosure C_TreeModelRowChangedCallback) #
Wrap the callback into a GClosure
.
noTreeModelRowChangedCallback :: Maybe TreeModelRowChangedCallback #
A convenience synonym for
.Nothing
:: Maybe
TreeModelRowChangedCallback
mk_TreeModelRowChangedCallback :: C_TreeModelRowChangedCallback -> IO (FunPtr C_TreeModelRowChangedCallback) #
Generate a function pointer callable from C code, from a C_TreeModelRowChangedCallback
.
mk_TreeModelRowDeletedCallback :: C_TreeModelRowDeletedCallback -> IO (FunPtr C_TreeModelRowDeletedCallback) #
Generate a function pointer callable from C code, from a C_TreeModelRowDeletedCallback
.
mk_TreeModelRowHasChildToggledCallback :: C_TreeModelRowHasChildToggledCallback -> IO (FunPtr C_TreeModelRowHasChildToggledCallback) #
Generate a function pointer callable from C code, from a C_TreeModelRowHasChildToggledCallback
.
mk_TreeModelRowInsertedCallback :: C_TreeModelRowInsertedCallback -> IO (FunPtr C_TreeModelRowInsertedCallback) #
Generate a function pointer callable from C code, from a C_TreeModelRowInsertedCallback
.
type TreeModelRowChangedCallback #
= TreePath |
|
-> TreeIter |
|
-> IO () |
This signal is emitted when a row in the model has changed.
type C_TreeModelRowChangedCallback = Ptr () -> Ptr TreePath -> Ptr TreeIter -> Ptr () -> IO () #
Type for the callback on the (unwrapped) C side.
type TreeModelRowDeletedCallback #
This signal is emitted when a row has been deleted.
Note that no iterator is passed to the signal handler, since the row is already deleted.
This should be called by models after a row has been removed.
The location pointed to by path
should be the location that
the row previously was at. It may not be a valid location anymore.
type C_TreeModelRowDeletedCallback = Ptr () -> Ptr TreePath -> Ptr () -> IO () #
Type for the callback on the (unwrapped) C side.
type TreeModelRowHasChildToggledCallback #
= TreePath |
|
-> TreeIter |
|
-> IO () |
This signal is emitted when a row has gotten the first child row or lost its last child row.
type C_TreeModelRowHasChildToggledCallback = Ptr () -> Ptr TreePath -> Ptr TreeIter -> Ptr () -> IO () #
Type for the callback on the (unwrapped) C side.
type TreeModelRowInsertedCallback #
= TreePath |
|
-> TreeIter |
|
-> IO () |
This signal is emitted when a new row has been inserted in the model.
Note that the row may still be empty at this point, since it is a common pattern to first insert an empty row, and then fill it with the desired values.
type C_TreeModelRowInsertedCallback = Ptr () -> Ptr TreePath -> Ptr TreeIter -> Ptr () -> IO () #
Type for the callback on the (unwrapped) C side.
Memory-managed wrapper type.
Instances
GObject TreeModel | |
Defined in GI.Gtk.Interfaces.TreeModel gobjectType :: IO GType # | |
(info ~ ResolveTreeModelMethod t TreeModel, MethodInfo info TreeModel p) => IsLabel t (TreeModel -> p) | |
Defined in GI.Gtk.Interfaces.TreeModel | |
HasParentTypes TreeModel | |
Defined in GI.Gtk.Interfaces.TreeModel | |
HasAttributeList TreeModel | |
Defined in GI.Gtk.Interfaces.TreeModel | |
type ParentTypes TreeModel | |
Defined in GI.Gtk.Interfaces.TreeModel | |
type AttributeList TreeModel | |
Defined in GI.Gtk.Interfaces.TreeModel | |
type SignalList TreeModel | |
Defined in GI.Gtk.Interfaces.TreeModel |
class (GObject o, IsDescendantOf TreeModel o) => IsTreeModel o #
Type class for types which can be safely cast to TreeModel
, for instance with toTreeModel
.
Instances
(GObject o, IsDescendantOf TreeModel o) => IsTreeModel o | |
Defined in GI.Gtk.Interfaces.TreeModel |
data TreeModelFilterNewMethodInfo #
Instances
(signature ~ (Maybe TreePath -> m TreeModel), MonadIO m, IsTreeModel a) => MethodInfo TreeModelFilterNewMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelFilterNewMethodInfo -> a -> signature # |
data TreeModelForeachMethodInfo #
Instances
(signature ~ (TreeModelForeachFunc -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelForeachMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelForeachMethodInfo -> a -> signature # |
data TreeModelGetColumnTypeMethodInfo #
Instances
(signature ~ (Int32 -> m GType), MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetColumnTypeMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetColumnTypeMethodInfo -> a -> signature # |
data TreeModelGetFlagsMethodInfo #
Instances
(signature ~ m [TreeModelFlags], MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetFlagsMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetFlagsMethodInfo -> a -> signature # |
data TreeModelGetIterFirstMethodInfo #
Instances
(signature ~ m (Bool, TreeIter), MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetIterFirstMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetIterFirstMethodInfo -> a -> signature # |
data TreeModelGetIterFromStringMethodInfo #
Instances
(signature ~ (Text -> m (Bool, TreeIter)), MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetIterFromStringMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetIterFromStringMethodInfo -> a -> signature # |
data TreeModelGetIterMethodInfo #
Instances
(signature ~ (TreePath -> m (Bool, TreeIter)), MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetIterMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetIterMethodInfo -> a -> signature # |
data TreeModelGetNColumnsMethodInfo #
Instances
(signature ~ m Int32, MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetNColumnsMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetNColumnsMethodInfo -> a -> signature # |
data TreeModelGetPathMethodInfo #
Instances
(signature ~ (TreeIter -> m TreePath), MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetPathMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetPathMethodInfo -> a -> signature # |
data TreeModelGetStringFromIterMethodInfo #
Instances
(signature ~ (TreeIter -> m Text), MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetStringFromIterMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetStringFromIterMethodInfo -> a -> signature # |
data TreeModelGetValueMethodInfo #
Instances
(signature ~ (TreeIter -> Int32 -> m GValue), MonadIO m, IsTreeModel a) => MethodInfo TreeModelGetValueMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelGetValueMethodInfo -> a -> signature # |
data TreeModelIterChildrenMethodInfo #
Instances
(signature ~ (Maybe TreeIter -> m (Bool, TreeIter)), MonadIO m, IsTreeModel a) => MethodInfo TreeModelIterChildrenMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelIterChildrenMethodInfo -> a -> signature # |
data TreeModelIterHasChildMethodInfo #
Instances
(signature ~ (TreeIter -> m Bool), MonadIO m, IsTreeModel a) => MethodInfo TreeModelIterHasChildMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelIterHasChildMethodInfo -> a -> signature # |
data TreeModelIterNChildrenMethodInfo #
Instances
(signature ~ (Maybe TreeIter -> m Int32), MonadIO m, IsTreeModel a) => MethodInfo TreeModelIterNChildrenMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelIterNChildrenMethodInfo -> a -> signature # |
data TreeModelIterNextMethodInfo #
Instances
(signature ~ (TreeIter -> m Bool), MonadIO m, IsTreeModel a) => MethodInfo TreeModelIterNextMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelIterNextMethodInfo -> a -> signature # |
data TreeModelIterNthChildMethodInfo #
Instances
(signature ~ (Maybe TreeIter -> Int32 -> m (Bool, TreeIter)), MonadIO m, IsTreeModel a) => MethodInfo TreeModelIterNthChildMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelIterNthChildMethodInfo -> a -> signature # |
data TreeModelIterParentMethodInfo #
Instances
(signature ~ (TreeIter -> m (Bool, TreeIter)), MonadIO m, IsTreeModel a) => MethodInfo TreeModelIterParentMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelIterParentMethodInfo -> a -> signature # |
data TreeModelIterPreviousMethodInfo #
Instances
(signature ~ (TreeIter -> m Bool), MonadIO m, IsTreeModel a) => MethodInfo TreeModelIterPreviousMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelIterPreviousMethodInfo -> a -> signature # |
data TreeModelRefNodeMethodInfo #
Instances
(signature ~ (TreeIter -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelRefNodeMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelRefNodeMethodInfo -> a -> signature # |
data TreeModelRowChangedMethodInfo #
Instances
(signature ~ (TreePath -> TreeIter -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelRowChangedMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelRowChangedMethodInfo -> a -> signature # |
data TreeModelRowChangedSignalInfo #
Instances
SignalInfo TreeModelRowChangedSignalInfo | |
Defined in GI.Gtk.Interfaces.TreeModel | |
type HaskellCallbackType TreeModelRowChangedSignalInfo | |
data TreeModelRowDeletedMethodInfo #
Instances
(signature ~ (TreePath -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelRowDeletedMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelRowDeletedMethodInfo -> a -> signature # |
data TreeModelRowDeletedSignalInfo #
Instances
SignalInfo TreeModelRowDeletedSignalInfo | |
Defined in GI.Gtk.Interfaces.TreeModel | |
type HaskellCallbackType TreeModelRowDeletedSignalInfo | |
data TreeModelRowHasChildToggledMethodInfo #
Instances
(signature ~ (TreePath -> TreeIter -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelRowHasChildToggledMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelRowHasChildToggledMethodInfo -> a -> signature # |
data TreeModelRowInsertedMethodInfo #
Instances
(signature ~ (TreePath -> TreeIter -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelRowInsertedMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelRowInsertedMethodInfo -> a -> signature # |
data TreeModelRowInsertedSignalInfo #
Instances
SignalInfo TreeModelRowInsertedSignalInfo | |
Defined in GI.Gtk.Interfaces.TreeModel | |
type HaskellCallbackType TreeModelRowInsertedSignalInfo | |
data TreeModelRowsReorderedMethodInfo #
Instances
(signature ~ (TreePath -> Maybe TreeIter -> [Int32] -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelRowsReorderedMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelRowsReorderedMethodInfo -> a -> signature # |
data TreeModelSortNewWithModelMethodInfo #
Instances
(signature ~ m TreeModel, MonadIO m, IsTreeModel a) => MethodInfo TreeModelSortNewWithModelMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelSortNewWithModelMethodInfo -> a -> signature # |
data TreeModelUnrefNodeMethodInfo #
Instances
(signature ~ (TreeIter -> m ()), MonadIO m, IsTreeModel a) => MethodInfo TreeModelUnrefNodeMethodInfo a signature | |
Defined in GI.Gtk.Interfaces.TreeModel overloadedMethod :: MethodProxy TreeModelUnrefNodeMethodInfo -> a -> signature # |
Constructors
invalidColumnId :: ColumnId row ty Source #
The invalid ColumnId
. Widgets use this value if no column id has
been set.
Methods
stringToTreePath :: Text -> [Int32] Source #
Convert a comma or colon separated string into a TreePath
. Any
non-digit characters are assumed to separate indices, thus, the function
always is always successful.
:: IsTreeModel self | |
=> self | |
-> TreeIter | |
-> ColumnId row ty |
|
-> IO ty |
Read the value of at a specific column and TreeIter
.
treeModelGetIter :: (MonadIO m, IsTreeModel model) => model -> TreePath -> m (Maybe TreeIter) Source #
Gets the a TreeIter
or Nothing if the path is invalid or empty