Gtk2HsContentsIndex
Graphics.UI.Gtk.TreeList.TreeStore
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Contents
Detail
Class Hierarchy
Types
Constructors
Methods
Description
A tree-like data structure that can be used with the TreeView
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
show/hide Instances
class TreeModelClass o => TreeStoreClass o
show/hide Instances
castToTreeStore :: GObjectClass obj => obj -> TreeStore
toTreeStore :: TreeStoreClass o => o -> TreeStore
data TMType
Constructors
TMinvalid
TMuint
TMint
TMboolean
TMenum
TMflags
TMfloat
TMdouble
TMstring
TMobject
show/hide Instances
data GenericValue

A union with information about the currently stored type.

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 tiTreeIter 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 TreeIterparent - A valid TreeIter, or Nothing
-> Intposition - 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 TreeIterparent - A valid TreeIter, or Nothing
-> IO TreeIter

Insert a child node in front of every other sibling.

treeStoreAppend
:: TreeStoreClass self
=> self
-> Maybe TreeIterparent - A valid TreeIter, or Nothing
-> IO TreeIter

Insert a child node behind other siblings.

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 0.8