Gtk2HsContentsIndex
Graphics.UI.Gtk.Mogul.TreeList
Contents
ListStore
TreeStore
Widget
CellRenderer
CellRendererText
Description

This module provides all object for a widget displaying data organized in a table.

  • There are two flavors: A simple list organizes data in rows and a tree which provides the possibility to impose a hierarchical structure on the entries of one column.
  • The widget is composed of two parts: A database holding rows of data and the widget object itself which displays items based on the database. Several widgets may use a single storage object. The data in the database may be what is directly displayed like strings and images or it may be some meta information like the padding or color of an item. Several attributes in the storage object may be used to display one column in the widget. In contrast each row in the store corresponds to a row in the widget.
  • The widget that displays the data and can be inserted like any other into a container is called TreeView. This widget is itself a container for TreeViewColumns which has a title at the top of the column. Each TreeViewColumn in turn can contain several Renderer. There are currently three Renderer, one for each of the following items: text, Pixbuf and ToggleButton.
  • The database is called store, specifically for simple lists it is ListStore and for hierachical data it is called TreeStore. A store is created from a skeleton. '' Attributes can be added to an empty ListSkel or TreeSkel skeleton which yields a functions to access the attribute and an Association. After the skeleton is turned into a store by calling either newListStore or newTreeStore, Associations can be inserted together with an appropriate Renderer into a TreeViewColumn.

TODO

  • Figure out if properties in the store have priority over global properties when both are set.
Synopsis
data ListSkel
emptyListSkel :: IO ListSkel
listSkelAddAttribute :: CellRendererClass cr => ListSkel -> Attribute cr argTy -> IO (Association cr, TreeIter -> IO argTy, TreeIter -> argTy -> IO ())
newListStore :: ListSkel -> IO ListStore
data TreeSkel
emptyTreeSkel :: IO TreeSkel
treeSkelAddAttribute :: CellRendererClass r => TreeSkel -> Attribute r argTy -> IO (Association r, TreeIter -> IO argTy, TreeIter -> argTy -> IO ())
newTreeStore :: TreeSkel -> IO TreeStore
data Association cr
data Renderer cr
treeViewColumnNewText :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererText)
treeViewColumnNewPixbuf :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererPixbuf)
treeViewColumnNewToggle :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererToggle)
treeViewColumnAssociate :: CellRendererClass r => Renderer r -> [Association r] -> IO ()
cellRendererSetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> val -> IO ()
cellRendererGetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> IO val
onEdited :: TreeModelClass tm => Renderer CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)
afterEdited :: TreeModelClass tm => Renderer CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)
ListStore
data ListSkel

A skeleton of a ListStore database.

  • This datastructure describes what columns the database will have when it is finally created by newListStore.
emptyListSkel :: IO ListSkel
Returns an empty ListSkel.
listSkelAddAttribute :: CellRendererClass cr => ListSkel -> Attribute cr argTy -> IO (Association cr, TreeIter -> IO argTy, TreeIter -> argTy -> IO ())

Reserve a new column in ListSkel to hold values for the given attribute.

  • The type of the column is determined by the given Attribute of the ViewColumn which should be stored here. It is possible to associate this column with several ViewColumns.
newListStore :: ListSkel -> IO ListStore

Create a new ListStore database.

  • This method throws an exception if the skeleton has been used before.
TreeStore
data TreeSkel

A skeleton of a TreeStore database.

  • This datastructure describes what columns the database will have when it is finally created by newTreeStore
emptyTreeSkel :: IO TreeSkel
Returns an empty TreeSkel.
treeSkelAddAttribute :: CellRendererClass r => TreeSkel -> Attribute r argTy -> IO (Association r, TreeIter -> IO argTy, TreeIter -> argTy -> IO ())

Reserve a new column in TreeSkel to hold values for the given attribute.

  • The type of the column is determined by the given Attribute of the ViewColumn which should be stored here. It is possible to associate this column with several ViewColumns.
newTreeStore :: TreeSkel -> IO TreeStore

Create a new TreeStore database.

  • This method throws an exception if the skeleton has been used before.
Widget
data Association cr
An abstract link between a store and a view.
data Renderer cr
A renderer for text in a TreeView.
treeViewColumnNewText :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererText)

Create a new rederer showing text.

treeViewColumnNewPixbuf :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererPixbuf)

Create a new renderer showing a Pixbuf.

treeViewColumnNewToggle :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererToggle)

Create a new renderer showing a ToggleButton.

treeViewColumnAssociate :: CellRendererClass r => Renderer r -> [Association r] -> IO ()

Create a link between the store and this model.

CellRenderer
cellRendererSetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> val -> IO ()

Set an Attribute globally.

cellRendererGetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> IO val
Get an global Attribute.
CellRendererText
onEdited :: TreeModelClass tm => Renderer CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)

Emitted when the user finished editing a cell.

  • This signal is not emitted when editing is disabled (see cellEditable) or when the user aborts editing.
afterEdited :: TreeModelClass tm => Renderer CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)
Produced by Haddock version 0.7