Source codeContentsIndex
TreeList
Description
HTk's TreeList module.
Synopsis
newTreeList :: (Container par, CItem a) => par -> ChildrenFun a -> [TreeListObject a] -> [Config (TreeList a)] -> IO (TreeList a)
data TreeList c
bindTreeListEv :: (CItem c) => TreeList c -> IO (Event (TreeListEvent c), IO ())
data TreeListEvent c
= Selected (Maybe (TreeListObject c))
| Focused (Maybe (TreeListObject c), EventInfo)
updateTreeList :: (CItem a) => TreeList a -> IO ()
addTreeListRootObject :: (CItem a) => TreeList a -> TreeListObject a -> IO ()
addTreeListSubObject :: (CItem a) => TreeList a -> a -> TreeListObject a -> IO ()
newTreeListObject :: (CItem a) => a -> TreeListObjectType -> TreeListObject a
data TreeListObject a
data TreeListObjectType
= Node
| Leaf
isLeaf :: (CItem a) => TreeList a -> a -> IO (Maybe Bool)
isNode :: (CItem a) => TreeList a -> a -> IO (Maybe Bool)
mkLeaf :: (CItem a) => TreeList a -> a -> IO ()
mkNode :: (CItem a) => TreeList a -> a -> IO ()
getTreeListObjectValue :: TreeListObject a -> a
getTreeListObjectType :: TreeListObject a -> TreeListObjectType
isTreeListObjectOpen :: (CItem c) => TreeList c -> c -> IO Bool
type ChildrenFun a = TreeListObject a -> IO [TreeListObject a]
setImage :: (CItem a) => TreeList a -> a -> Image -> IO ()
setTreeListObjectName :: (CItem a) => TreeList a -> a -> Name -> IO ()
data TreeListExportItem a = TreeListExportItem {
obj_val :: a
obj_type :: TreeListObjectType
open :: Bool
intend :: Int
selected :: Bool
}
type TreeListState a = [TreeListExportItem a]
exportTreeListState :: (CItem c) => TreeList c -> IO (TreeListState c)
importTreeListState :: (CItem a) => TreeList a -> TreeListState a -> IO ()
recoverTreeList :: (Container par, CItem a) => par -> ChildrenFun a -> TreeListState a -> [Config (TreeList a)] -> IO (TreeList a)
module CItem
Documentation
newTreeList
:: (Container par, CItem a)
=> par the parent widget, which has to be a container widget.
-> ChildrenFun a the tree list's children function.
-> [TreeListObject a] the initial list of tree list objects.
-> [Config (TreeList a)] the list of configuration options for this tree list.
-> IO (TreeList a) A tree list.
Constructs a new tree list.
data TreeList c
The TreeList datatype.
bindTreeListEv
:: (CItem c)
=> TreeList c the concerned tree list.
-> IO (Event (TreeListEvent c), IO ()) A pair of (event, unbind action).
Binds a listener for tree list events to the tree list and returns a corresponding event and an unbind action.
data TreeListEvent c
The TreeListEvent datatype.
Constructors
Selected (Maybe (TreeListObject c))
Focused (Maybe (TreeListObject c), EventInfo)
updateTreeList
:: (CItem a)
=> TreeList a the concerned tree list.
-> IO () None.
Updates the tree list by recalling the children function for all opened objects.
addTreeListRootObject
:: (CItem a)
=> TreeList a the concerned tree list.
-> TreeListObject a the tree list object to add.
-> IO () None.
Adds a toplevel tree list object.
addTreeListSubObject
:: (CItem a)
=> TreeList a the concerned tree list.
-> a the parent object's value.
-> TreeListObject a the new tree list object to add.
-> IO () None.
Adds a subobject to a tree list object.
newTreeListObject
:: (CItem a)
=> a the object's value.
-> TreeListObjectType the object's type (node or leaf).
-> TreeListObject a A tree list object.
Constructs a new tree list object.
data TreeListObject a
The TreeListObject datatype.
data TreeListObjectType
Constructors
Node
Leaf
isLeaf
:: (CItem a)
=> TreeList a the concerned tree list.
-> a the concerned tree list object value.
-> IO (Maybe Bool) Nothing if no corresponding object is found, otherwise Just True if the corresponding object is a leaf, otherwise Just False.
Checks for a given tree list object value if the corresponding object is a leaf.
isNode
:: (CItem a)
=> TreeList a the concerned tree list.
-> a the concerned tree list object value.
-> IO (Maybe Bool) Nothing if no corresponding object is found, otherwise Just True if the corresponding object is a node, otherwise Just False.
Checks for a given tree list object value if the corresponding object is a node.
mkLeaf
:: (CItem a)
=> TreeList a the concerned tree list.
-> a the concerned tree list object's value.
-> IO () None.
Converts the corresponding object to a given tree list object value to a leaf.
mkNode
:: (CItem a)
=> TreeList a the concerned tree list.
-> a the concerned treelist object's value.
-> IO () None.
Converts the corresponding object to a given tree list object value to a node.
getTreeListObjectValue
:: TreeListObject a the concerned tree list object.
-> a The given object's value.
Selector for the value of a tree list object.
getTreeListObjectType
:: TreeListObject a the concerned tree list object.
-> TreeListObjectType The object's type (node or leaf).
Selector for the type of a tree list object (node or leaf).
isTreeListObjectOpen
:: (CItem c)
=> TreeList c the concerned tree list.
-> c the concerned object's value.
-> IO Bool True, if the object with the given value is currently opened in the tree list, otherwise False.
True, if the object with the given value is currently opened in the tree list.
type ChildrenFun a = TreeListObject a -> IO [TreeListObject a]
The ChildrenFun type.
setImage
:: (CItem a)
=> TreeList a the concerned tree list.
-> a the concerned object's value.
-> Image the image to set.
-> IO () None.
(Re-)sets the image of a tree list object.
setTreeListObjectName
:: (CItem a)
=> TreeList a the concerned tree list.
-> a the concerned object's value.
-> Name the name to set.
-> IO () None.
(Re-)sets the name of a tree list object.
data TreeListExportItem a
Constructors
TreeListExportItem
obj_val :: a
obj_type :: TreeListObjectType
open :: Bool
intend :: Int
selected :: Bool
type TreeListState a = [TreeListExportItem a]
exportTreeListState
:: (CItem c)
=> TreeList c the concerned tree list.
-> IO (TreeListState c) The tree list's state.
Exports the tree list's state.
importTreeListState
:: (CItem a)
=> TreeList a the concerned tree list.
-> TreeListState a the state to import.
-> IO () None.
Imports a previously saved tree list state.
recoverTreeList
:: (Container par, CItem a)
=> par the parent widget, which has to be a container widget.
-> ChildrenFun a the tree list's children function.
-> TreeListState a the state to recover.
-> [Config (TreeList a)] the list of configuration options for this tree list.
-> IO (TreeList a) A tree list.
Constructs a new tree list recovering a previously saved state.
module CItem
Produced by Haddock version 0.3