<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Graphics.UI.Gtk.ModelView.ListStore</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_Graphics-UI-Gtk-ModelView-ListStore.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">gtk-0.12.0: Binding to the Gtk+ graphical user interface library.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable (depends on GHC)</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>gtk2hs-users@lists.sourceforge.net</td></tr></table><p class="caption">Graphics.UI.Gtk.ModelView.ListStore</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types </a></li><li><a href="#g:2">Constructors </a></li><li><a href="#g:3">Implementation of Interfaces </a></li><li><a href="#g:4">Methods </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Standard model to store list data. </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:ListStore">ListStore</a> a</li><li class="src short"><a href="#v:listStoreNew">listStoreNew</a> :: [a] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)</li><li class="src short"><a href="#v:listStoreNewDND">listStoreNewDND</a> :: [a] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragSourceIface">DragSourceIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragDestIface">DragDestIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)</li><li class="src short"><a href="#v:listStoreDefaultDragSourceIface">listStoreDefaultDragSourceIface</a> :: <a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragSourceIface">DragSourceIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> row</li><li class="src short"><a href="#v:listStoreDefaultDragDestIface">listStoreDefaultDragDestIface</a> :: <a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragDestIface">DragDestIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> row</li><li class="src short"><a href="#v:listStoreIterToIndex">listStoreIterToIndex</a> :: <a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreeIter">TreeIter</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:listStoreGetValue">listStoreGetValue</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:listStoreSetValue">listStoreSetValue</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:listStoreToList">listStoreToList</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> [a]</li><li class="src short"><a href="#v:listStoreGetSize">listStoreGetSize</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:listStoreInsert">listStoreInsert</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:listStorePrepend">listStorePrepend</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:listStoreAppend">listStoreAppend</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:listStoreRemove">listStoreRemove</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:listStoreClear">listStoreClear</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li></ul></div><div id="interface"><h1 id="g:1">Types </h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ListStore" class="def">ListStore</a> a <a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#ListStore" class="link">Source</a></p><div class="subs instances"><p id="control.i:ListStore" class="caption collapser" onclick="toggleSection('i:ListStore')">Instances</p><div id="section.i:ListStore" class="show"><table><tr><td class="src"><a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TypedTreeModelClass">TypedTreeModelClass</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObjectClass">GObjectClass</a> (<a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreeModelClass">TreeModelClass</a> (<a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:2">Constructors </h1><div class="top"><p class="src"><a name="v:listStoreNew" class="def">listStoreNew</a> :: [a] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)<a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreNew" class="link">Source</a></p><div class="doc"><p>Create a new <code><a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreeModel">TreeModel</a></code> that contains a list of elements. </p></div></div><div class="top"><p class="src"><a name="v:listStoreNewDND" class="def">listStoreNewDND</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreNewDND" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [a]</td><td class="doc"><p>the initial content of the model </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragSourceIface">DragSourceIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)</td><td class="doc"><p>an optional interface for drags </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragDestIface">DragDestIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)</td><td class="doc"><p>an optional interface to handle drops </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a)</td><td class="doc"><p>the new model </p></td></tr></table></div><div class="doc"><p>Create a new <code><a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreeModel">TreeModel</a></code> that contains a list of elements. In addition, specify two interfaces for drag and drop. </p></div></div><h1 id="g:3">Implementation of Interfaces </h1><div class="top"><p class="src"><a name="v:listStoreDefaultDragSourceIface" class="def">listStoreDefaultDragSourceIface</a> :: <a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragSourceIface">DragSourceIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> row<a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreDefaultDragSourceIface" class="link">Source</a></p><div class="doc"><p>Default drag functions for <code>Graphics.UI.Gtk.ModelView.ListStore</code>. 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 <code>SelectionDataM</code> object is set with <code><a href="Graphics-UI-Gtk-ModelView-TreeDrag.html#v:treeSetRowDragData">treeSetRowDragData</a></code>, i.e. it contains the model and the <code><a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreePath">TreePath</a></code> to the row. </p></div></div><div class="top"><p class="src"><a name="v:listStoreDefaultDragDestIface" class="def">listStoreDefaultDragDestIface</a> :: <a href="Graphics-UI-Gtk-ModelView-CustomStore.html#t:DragDestIface">DragDestIface</a> <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> row<a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreDefaultDragDestIface" class="link">Source</a></p><div class="doc"><p>Default drop functions for <code>Graphics.UI.Gtk.ModelView.ListStore</code>. 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. </p></div></div><h1 id="g:4">Methods </h1><div class="top"><p class="src"><a name="v:listStoreIterToIndex" class="def">listStoreIterToIndex</a> :: <a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreeIter">TreeIter</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreIterToIndex" class="link">Source</a></p><div class="doc"><p>Convert a <code><a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreeIter">TreeIter</a></code> to an an index into the <code><a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a></code>. Note that this function merely extracts the second element of the <code><a href="Graphics-UI-Gtk-ModelView-TreeModel.html#t:TreeIter">TreeIter</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:listStoreGetValue" class="def">listStoreGetValue</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> a<a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreGetValue" class="link">Source</a></p><div class="doc"><p>Extract the value at the given index. </p></div></div><div class="top"><p class="src"><a name="v:listStoreSetValue" class="def">listStoreSetValue</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreSetValue" class="link">Source</a></p><div class="doc"><p>Update the value at the given index. The index must exist. </p></div></div><div class="top"><p class="src"><a name="v:listStoreToList" class="def">listStoreToList</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> [a]<a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreToList" class="link">Source</a></p><div class="doc"><p>Extract all data from the store. </p></div></div><div class="top"><p class="src"><a name="v:listStoreGetSize" class="def">listStoreGetSize</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreGetSize" class="link">Source</a></p><div class="doc"><p>Query the number of elements in the store. </p></div></div><div class="top"><p class="src"><a name="v:listStoreInsert" class="def">listStoreInsert</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreInsert" class="link">Source</a></p><div class="doc"><p>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. </p></div></div><div class="top"><p class="src"><a name="v:listStorePrepend" class="def">listStorePrepend</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStorePrepend" class="link">Source</a></p><div class="doc"><p>Prepend the element to the store. </p></div></div><div class="top"><p class="src"><a name="v:listStoreAppend" class="def">listStoreAppend</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreAppend" class="link">Source</a></p><div class="doc"><p>Append an element to the store. Returns the index of the inserted element. </p></div></div><div class="top"><p class="src"><a name="v:listStoreRemove" class="def">listStoreRemove</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreRemove" class="link">Source</a></p><div class="doc"><p>Remove the element at the given index. </p></div></div><div class="top"><p class="src"><a name="v:listStoreClear" class="def">listStoreClear</a> :: <a href="Graphics-UI-Gtk-ModelView-ListStore.html#t:ListStore">ListStore</a> a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-ModelView-ListStore.html#listStoreClear" class="link">Source</a></p><div class="doc"><p>Empty the store. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>