| Gtk2Hs | Contents | Index

Graphics.UI.Gtk.TreeList.TreeStore

Portability | portable (depends on GHC)
Stability | provisional
Maintainer | gtk2hs-users@lists.sourceforge.net

Contents

Detail
Class Hierarchy
Types
Constructors
Methods

Description

A tree-like data structure that can be used with the `TreeView`

- This module and all other modules in Graphics.UI.Gtk.TreeList are deprecated. Please use the modules in Graphics.UI.Gtk.ModelView.

Synopsis

data TreeStore
class TreeModelClass o => TreeStoreClass o
castToTreeStore :: GObjectClass obj => obj -> TreeStore
toTreeStore :: TreeStoreClass o => o -> TreeStore

data TMType

= TMinvalid
| TMuint
| TMint
| TMboolean
| TMenum
| TMflags
| TMfloat
| TMdouble
| TMstring
| TMobject

data GenericValue

= GVuint Word
| GVint Int
| GVboolean Bool
| GVenum Int
| GVflags Int
| GVfloat Float
| GVdouble Double
| GVstring (Maybe String)
| GVobject GObject

treeStoreNew :: [TMType] -> IO TreeStore
treeStoreSetValue :: TreeStoreClass self => self -> TreeIter -> Int -> GenericValue -> IO ()
treeStoreRemove :: TreeStoreClass self => self -> TreeIter -> IO Bool
treeStoreInsert :: TreeStoreClass self => self -> Maybe TreeIter -> Int -> IO TreeIter
treeStoreInsertBefore :: TreeStoreClass self => self -> TreeIter -> IO TreeIter
treeStoreInsertAfter :: TreeStoreClass self => self -> TreeIter -> IO TreeIter
treeStorePrepend :: TreeStoreClass self => self -> Maybe TreeIter -> IO TreeIter
treeStoreAppend :: TreeStoreClass self => self -> Maybe TreeIter -> IO TreeIter
treeStoreIsAncestor :: TreeStoreClass self => self -> TreeIter -> TreeIter -> IO Bool
treeStoreIterDepth :: TreeStoreClass self => self -> TreeIter -> IO Int
treeStoreClear :: TreeStoreClass self => self -> IO ()

Detail
The `TreeStore` object is a list model for use with a `TreeView` widget. It implements the `TreeModel` interface, and consequentialy, can use all of the methods available there. It also implements the `TreeSortable` interface so it can be sorted by the view. Finally, it also implements the tree drag and drop interfaces.
Class Hierarchy

     |  GObject
     |   +----TreeStore

Types
data TreeStore

Instances

GObjectClass TreeStore
TreeStoreClass TreeStore
TreeModelClass TreeStore

class TreeModelClass o => TreeStoreClass o

Instances

TreeStoreClass TreeStore

castToTreeStore :: GObjectClass obj => obj -> TreeStore
toTreeStore :: TreeStoreClass o => o -> TreeStore
data TMType

Constructors

TMinvalid |
TMuint |
TMint |
TMboolean |
TMenum |
TMflags |
TMfloat |
TMdouble |
TMstring |
TMobject |

Instances

Enum TMType

data GenericValue

A union with information about the currently stored type.

- Internally used by Graphics.UI.Gtk.TreeList.TreeModel.

Constructors

GVuint Word |
GVint Int |
GVboolean Bool |
GVenum Int |
GVflags Int |
GVfloat Float |
GVdouble Double |
GVstring (Maybe String) |
GVobject GObject |

Constructors
treeStoreNew :: [TMType] -> IO TreeStore
Generate a new entity to store tree information.
Methods
treeStoreSetValue :: TreeStoreClass self => self -> TreeIter -> Int -> GenericValue -> IO ()
Set the data of a specific node. The supplied value must match the type that was set for the column.
treeStoreRemove :: TreeStoreClass self => self -> TreeIter -> IO Bool

Remove a specific node.

- The `TreeIter` will point to the entry following the one which was just removed. The function returns `False` if the `ti`TreeIter does not point to a valid element (i.e. the function just removed the bottom entry from the tree).
- This function returned `()` in Gtk version 2.0.X

treeStoreInsert

:: TreeStoreClass self |
=> self |
-> Maybe TreeIter | `parent` - A valid `TreeIter`, or `Nothing`
-> Int | `position` - position to insert the new row
-> IO TreeIter |
Insert a child node into the tree. If the parent is Nothing the insert at the root of the tree. The pos parameter determines the position with respect to other siblings. If the position is larger than the number of rows at that level, then the new row will be inserted at the end of the list.

treeStoreInsertBefore :: TreeStoreClass self => self -> TreeIter -> IO TreeIter
Insert a node in front of the `sibling` node on the same level.
treeStoreInsertAfter :: TreeStoreClass self => self -> TreeIter -> IO TreeIter
Insert a node behind the `sibling` node on the same level.
treeStorePrepend

:: TreeStoreClass self |
=> self |
-> Maybe TreeIter | `parent` - A valid `TreeIter`, or `Nothing`
-> IO TreeIter |

Insert a child node in front of every other sibling.

- This is equivalent to `treeStoreInsert` `parent 0` .

treeStoreAppend

:: TreeStoreClass self |
=> self |
-> Maybe TreeIter | `parent` - A valid `TreeIter`, or `Nothing`
-> IO TreeIter |

Insert a child node behind other siblings.

- This is equivalent to `treeStoreInsert` `parent (-1)` .

treeStoreIsAncestor :: TreeStoreClass self => self -> TreeIter -> TreeIter -> IO Bool
Check if a node is in a parental relationship with another node. Returns True even if parent is grandparent,... of child.
treeStoreIterDepth :: TreeStoreClass self => self -> TreeIter -> IO Int
Calculate the level of a node. Returns 1 for a root node.
treeStoreClear :: TreeStoreClass self => self -> IO ()
Removes all rows from the store.
Produced by Haddock version 2.4.2