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.ListStore

Contents

- Types
- Constructors
- Implementation of Interfaces
- Methods

Description

Standard model to store list data.

Synopsis

- data ListStore a
- listStoreNew :: [a] -> IO (ListStore a)
- listStoreNewDND :: [a] -> Maybe (DragSourceIface ListStore a) -> Maybe (DragDestIface ListStore a) -> IO (ListStore a)
- listStoreDefaultDragSourceIface :: DragSourceIface ListStore row
- listStoreDefaultDragDestIface :: DragDestIface ListStore row
- listStoreIterToIndex :: TreeIter -> Int
- listStoreGetValue :: ListStore a -> Int -> IO a
- listStoreSafeGetValue :: ListStore a -> Int -> IO (Maybe a)
- listStoreSetValue :: ListStore a -> Int -> a -> IO ()
- listStoreToList :: ListStore a -> IO [a]
- listStoreGetSize :: ListStore a -> IO Int
- listStoreInsert :: ListStore a -> Int -> a -> IO ()
- listStorePrepend :: ListStore a -> a -> IO ()
- listStoreAppend :: ListStore a -> a -> IO Int
- listStoreRemove :: ListStore a -> Int -> IO ()
- listStoreClear :: ListStore a -> IO ()

# Types

data ListStore a Source #

#### Instances

Instances details

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

# Constructors

listStoreNew :: [a] -> IO (ListStore a) Source #

Create a new `TreeModel` that contains a list of elements.

listStoreNewDND Source #

Arguments

:: [a] | the initial content of the model
-> Maybe (DragSourceIface ListStore a) | an optional interface for drags
-> Maybe (DragDestIface ListStore a) | an optional interface to handle drops
-> IO (ListStore a) | the new model

Create a new `TreeModel` that contains a list of elements. In addition, specify two interfaces for drag and drop.

# Implementation of Interfaces

listStoreDefaultDragSourceIface :: DragSourceIface ListStore row Source #

Default drag functions for `ListStore`. These functions allow the rows of the model to serve as drag source. Any row is allowed to be dragged and the data set in the `SelectionDataM` object is set with `treeSetRowDragData`, i.e. it contains the model and the `TreePath` to the row.

listStoreDefaultDragDestIface :: DragDestIface ListStore row Source #

Default drop functions for `ListStore`. These functions accept a row and insert the row into the new location if it is dragged into a tree view that uses the same model.

# Methods

listStoreIterToIndex :: TreeIter -> Int Source #

Convert a `TreeIter` to an an index into the `ListStore`. Note that this function merely extracts the second element of the `TreeIter`.

listStoreGetValue :: ListStore a -> Int -> IO a Source #

Extract the value at the given index.

listStoreSafeGetValue :: ListStore a -> Int -> IO (Maybe a) Source #

Extract the value at the given index.

listStoreSetValue :: ListStore a -> Int -> a -> IO () Source #

Update the value at the given index. The index must exist.

listStoreToList :: ListStore a -> IO [a] Source #

Extract all data from the store.

listStoreGetSize :: ListStore a -> IO Int Source #

Query the number of elements in the store.

listStoreInsert :: ListStore a -> Int -> a -> IO () Source #

Insert an element in front of the given element. The element is appended if the index is greater or equal to the size of the list.

listStorePrepend :: ListStore a -> a -> IO () Source #

Prepend the element to the store.

listStoreAppend :: ListStore a -> a -> IO Int Source #

Append an element to the store. Returns the index of the inserted element.

listStoreRemove :: ListStore a -> Int -> IO () Source #

Remove the element at the given index.

listStoreClear :: ListStore a -> IO () Source #

Empty the store.