gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.ModelView.TreeModelFilter

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes
- Orphan instances

Description

A `TreeModel` which hides parts of an underlying tree model

- Module available since Gtk+ version 2.4

Synopsis

- data TreeModelFilter
- data TypedTreeModelFilter row
- class GObjectClass o => TreeModelFilterClass o
- castToTreeModelFilter :: GObjectClass obj => obj -> TreeModelFilter
- gTypeTreeModelFilter :: GType
- toTreeModelFilter :: TreeModelFilterClass o => o -> TreeModelFilter
- treeModelFilterNew :: (TreeModelClass (childModel row), TypedTreeModelClass childModel) => childModel row -> TreePath -> IO (TypedTreeModelFilter row)
- treeModelFilterSetVisibleFunc :: TreeModelFilterClass self => self -> (TreeIter -> IO Bool) -> IO ()
- treeModelFilterSetVisibleColumn :: (TreeModelFilterClass (self row), TypedTreeModelClass self) => self row -> ColumnId row Bool -> IO ()
- treeModelFilterGetModel :: TreeModelFilterClass self => self -> IO (Maybe TreeModel)
- treeModelFilterConvertChildIterToIter :: TreeModelFilterClass self => self -> TreeIter -> IO TreeIter
- treeModelFilterConvertIterToChildIter :: TreeModelFilterClass self => self -> TreeIter -> IO TreeIter
- treeModelFilterConvertChildPathToPath :: TreeModelFilterClass self => self -> TreePath -> IO TreePath
- treeModelFilterConvertPathToChildPath :: TreeModelFilterClass self => self -> TreePath -> IO TreePath
- treeModelFilterRefilter :: TreeModelFilterClass self => self -> IO ()
- treeModelFilterClearCache :: TreeModelFilterClass self => self -> IO ()
- treeModelFilterChildModel :: TreeModelFilterClass self => ReadAttr self TreeModel
- treeModelFilterVirtualRoot :: TreeModelFilterClass self => ReadAttr self TreePath

# Detail

A `TreeModelFilter` is a tree model which wraps another tree model, and can do the following things:

- Filter specific rows, based on a function that examines each row indicating whether the row should be shown or not, or based on the return value of a visibility function, which is passed the `TreeIter` of the row and returns a Boolean indicating whether the row should be shown or not.
- Set a different root node, also known as a "virtual root". You can pass in a `TreePath` indicating the root node for the filter at construction time.

# Class Hierarchy

    | GObject
    | +----TreeModelFilter
    | +----TypedTreeModelFilter

# Types

data TreeModelFilter Source #

#### Instances

Instances details

Eq TreeModelFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: TreeModelFilter -> TreeModelFilter -> Bool Source # (/=) :: TreeModelFilter -> TreeModelFilter -> Bool Source #
Ord TreeModelFilter Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: TreeModelFilter -> TreeModelFilter -> Ordering Source #

(<) :: TreeModelFilter -> TreeModelFilter -> Bool Source #

(<=) :: TreeModelFilter -> TreeModelFilter -> Bool Source #

(>) :: TreeModelFilter -> TreeModelFilter -> Bool Source #

(>=) :: TreeModelFilter -> TreeModelFilter -> Bool Source #

max :: TreeModelFilter -> TreeModelFilter -> TreeModelFilter Source #

min :: TreeModelFilter -> TreeModelFilter -> TreeModelFilter Source #

GObjectClass TreeModelFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: TreeModelFilter -> GObject Source # unsafeCastGObject :: GObject -> TreeModelFilter Source #
TreeModelFilterClass TreeModelFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types

data TypedTreeModelFilter row Source #

#### Instances

Instances details

TypedTreeModelClass TypedTreeModelFilter Source # |
Instance details Defined in Graphics.UI.Gtk.ModelView.Types Methods dummy :: TypedTreeModelFilter a -> a
GObjectClass (TypedTreeModelFilter a) Source # |
Instance details Defined in Graphics.UI.Gtk.ModelView.TreeModelFilter Methods toGObject :: TypedTreeModelFilter a -> GObject Source # unsafeCastGObject :: GObject -> TypedTreeModelFilter a Source #
TreeModelClass (TypedTreeModelFilter a) Source # |
Instance details Defined in Graphics.UI.Gtk.ModelView.TreeModelFilter
TreeModelFilterClass (TypedTreeModelFilter a) Source # |
Instance details Defined in Graphics.UI.Gtk.ModelView.TreeModelFilter

class GObjectClass o => TreeModelFilterClass o Source #

#### Instances

Instances details

TreeModelFilterClass TreeModelFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types
TreeModelFilterClass (TypedTreeModelFilter a) Source # |
Instance details Defined in Graphics.UI.Gtk.ModelView.TreeModelFilter

castToTreeModelFilter :: GObjectClass obj => obj -> TreeModelFilter Source #

gTypeTreeModelFilter :: GType Source #

toTreeModelFilter :: TreeModelFilterClass o => o -> TreeModelFilter Source #

# Constructors

treeModelFilterNew Source #

Arguments

:: (TreeModelClass (childModel row), TypedTreeModelClass childModel) |
=> childModel row | `childModel` - A `TreeModel`.
-> TreePath | `root` - A `TreePath` or `[]`.
-> IO (TypedTreeModelFilter row) |

Creates a new `TreeModel`, with `childModel` as the child model and `root` as the virtual root.

# Methods

treeModelFilterSetVisibleFunc Source #

Arguments

:: TreeModelFilterClass self |
=> self |
-> (TreeIter -> IO Bool) | `func` - The visible function
-> IO () |

Sets the visible function used when filtering the rows to be `func`. The function should return `True` if the given row should be visible and `False` otherwise. The passed-in iterator is an iterator of the child model, not of the `TreeModelFilter` model that is passed in as the first argument to this function.

If the condition calculated by the function changes over time (e.g. because it depends on some global parameters), you must call `treeModelFilterRefilter` to keep the visibility information of the model up to date.

treeModelFilterSetVisibleColumn Source #

Arguments

:: (TreeModelFilterClass (self row), TypedTreeModelClass self) |
=> self row |
-> ColumnId row Bool | `column` - A column of Booleans that determines if a row is visible
-> IO () |

Sets `column` of the child model to be the column where the filter model should look for visibility information. A row containing `True` means that this row should be shown.

treeModelFilterGetModel Source #

Arguments

:: TreeModelFilterClass self |
=> self |
-> IO (Maybe TreeModel) | returns a `TreeModel`.

Returns a pointer to the child model of `filter`.

treeModelFilterConvertChildIterToIter :: TreeModelFilterClass self => self -> TreeIter -> IO TreeIter Source #

Return an iterator in the sorted model that points to the row pointed to by the given iter from the unfiltered model.

treeModelFilterConvertIterToChildIter :: TreeModelFilterClass self => self -> TreeIter -> IO TreeIter Source #

Return an iterator in the unfiltered model that points to the row pointed to by the given iter from the filtered model.

treeModelFilterConvertChildPathToPath :: TreeModelFilterClass self => self -> TreePath -> IO TreePath Source #

Converts the given path to a path relative to the given filtered model.

- The given path points to a row in the child model. The returned path will point to the same row in the filtered model.

treeModelFilterConvertPathToChildPath :: TreeModelFilterClass self => self -> TreePath -> IO TreePath Source #

Converts path in the filtered model to a path on the unfiltered model on which the given `TreeModelFilter` is based. That is, the given path points to a location in the given `TreeModelFilter`. The returned path will point to the same location in the underlying unfiltered model.

treeModelFilterRefilter :: TreeModelFilterClass self => self -> IO () Source #

Emits `rowChanged` for each row in the child model, which causes the filter to re-evaluate whether a row is visible or not.

treeModelFilterClearCache Source #

Arguments

:: TreeModelFilterClass self |
=> self | `filter` - the filter model
-> IO () |

This function should almost never be called. It clears the `filter` of any cached iterators that haven't been reffed with `treeModelRefNode`. This might be useful if the child model being filtered is static (and doesn't change often) and there has been a lot of unreffed access to nodes. As a side effect of this function, all unreffed iters will be invalid.

# Attributes

treeModelFilterChildModel :: TreeModelFilterClass self => ReadAttr self TreeModel Source #

The model for the filtermodel to filter.

treeModelFilterVirtualRoot :: TreeModelFilterClass self => ReadAttr self TreePath Source #

The virtual root (relative to the child model) for this filtermodel.

# Orphan instances

GObjectClass (TypedTreeModelFilter a) Source # |
Instance details Methods toGObject :: TypedTreeModelFilter a -> GObject Source # unsafeCastGObject :: GObject -> TypedTreeModelFilter a Source #
TreeModelClass (TypedTreeModelFilter a) Source # |
Instance details
TreeModelFilterClass (TypedTreeModelFilter a) Source # |
Instance details