module Graphics.UI.Gtk.Generics.ListStore where
import Graphics.UI.Gtk
import Control.Monad( forM_ )
listStoreRepopulate :: ListStore a -> [a] -> IO ( )
listStoreRepopulate store elements = do
listStoreClear store
forM_ elements $ \row -> listStoreAppend store row
listStoreGetValueAtPath :: TreePath -> ListStore a -> IO a
listStoreGetValueAtPath (x:_) store = listStoreGetValue store x
listStorePrependList :: ListStore a -> [a] -> IO ( )
listStorePrependList store list = ( listStoreToList store >>= (\l ->
listStoreRepopulate store ( list ++ l ) ) )
listStoreAppendList :: ListStore a -> [a] -> IO ( )
listStoreAppendList store list = ( listStoreToList store >>= (\l ->
listStoreRepopulate store ( l ++ list ) ) )