Name

TreeView —

This widget constitutes the main widget for displaying lists and other structured data.

Synopsis

data
        Association cr
data
        Renderer cr
type
        TreeViewColumnDropFunc
type
        TreeViewMappingFunc
treeViewNew:: IO TreeView
treeViewNewWithModel:: TreeModelClass tm => tm -> IO TreeView
treeViewAppendColumn:: TreeViewClass tv => tv -> TreeViewColumn -> IO Int
treeViewCollapseAll:: TreeViewClass tv => tv -> IO ()
treeViewCollapseRow:: TreeViewClass tv => tv -> TreePath -> IO Bool
treeViewColumnAssociate:: CellRendererClass r => Renderer r -> [Association r] -> IO ()
treeViewColumnNewPixbuf:: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererPixbuf)
treeViewColumnNewText:: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererText)
treeViewColumnsAutosize:: TreeViewClass tv => tv -> IO ()
treeViewExpandAll:: TreeViewClass tv => tv -> IO ()
treeViewExpandRow:: TreeViewClass tv => TreePath -> Bool -> tv -> IO Bool
treeViewExpandToPath:: TreeViewClass tv => tv -> TreePath -> IO ()
treeViewGetColumn:: TreeViewClass tv => tv -> Int -> IO (Maybe TreeViewColumn)
treeViewGetColumns:: TreeViewClass tv => tv -> IO [TreeViewColumn]
treeViewGetCursor:: TreeViewClass tv => tv -> IO (Maybe TreePath,Maybe TreeViewColumn)
treeViewGetExpanderColumn:: TreeViewClass tv => tv -> IO TreeViewColumn
treeViewGetHadjustment:: TreeViewClass tv => tv -> IO (Maybe Adjustment)
treeViewGetHeadersVisible:: TreeViewClass tv => tv -> IO Bool
treeViewGetModel:: TreeViewClass tv => tv -> IO (Maybe TreeModel)

treeViewGetPathAtPos <no type information>

treeViewGetReorderable:: TreeViewClass tv => tv -> IO Bool
treeViewGetRulesHint:: TreeViewClass tv => tv -> IO Bool
treeViewGetSelection:: TreeViewClass tv => tv -> IO TreeSelection
treeViewGetVadjustment:: TreeViewClass tv => tv -> IO (Maybe Adjustment)
treeViewInsertColumn:: TreeViewClass tv => tv -> TreeViewColumn -> Int -> IO Int
treeViewInsertColumnWithAttributes:: (TreeViewClass tv, CellRendererClass cr) => tv -> Int -> String -> cr -> [(String,Int)] -> IO ()
treeViewMapExpandedRows:: TreeViewClass tv => tv -> (TreePath -> IO ()) -> IO ()
treeViewMoveColumnAfter:: TreeViewClass tv => tv -> TreeViewColumn -> TreeViewColumn -> IO ()
treeViewMoveColumnFirst:: TreeViewClass tv => tv -> TreeViewColumn -> IO ()
treeViewRemoveColumn:: TreeViewClass tv => tv -> TreeViewColumn -> IO Int
treeViewRowActivated:: TreeViewClass tv => tv -> TreePath -> TreeViewColumn -> IO ()
treeViewRowExpanded:: TreeViewClass tv => tv -> TreePath -> IO Bool
treeViewScrollToCell:: TreeViewClass tv => tv -> TreePath -> TreeViewColumn -> Maybe (Float,Float) -> IO ()
treeViewScrollToPoint:: TreeViewClass tv => tv -> Int -> Int -> IO ()
treeViewSetColumnDragFunction:: TreeViewClass tv => tv -> Maybe (TreeViewColumn -> Maybe TreeViewColumn -> Maybe TreeViewColumn -> IO Bool) -> IO ()
treeViewSetCursor:: TreeViewClass tv => tv -> TreePath -> (Maybe (TreeViewColumn,Bool)) -> IO ()
treeViewSetCursorOnCell:: TreeViewClass tv => tv -> TreePath -> TreeViewColumn -> CellRenderer -> Bool -> IO ()
treeViewSetExpanderColumn:: TreeViewClass tv => tv -> Maybe TreeViewColumn -> IO ()
treeViewSetHadjustment:: TreeViewClass tv => (Maybe Adjustment) -> tv -> IO ()
treeViewSetHeadersClickable:: TreeViewClass tv => tv -> Bool -> IO ()
treeViewSetHeadersVisible:: TreeViewClass tv => tv -> Bool -> IO ()
treeViewSetModel:: (TreeViewClass tv, TreeModelClass tm) => tv -> tm -> IO ()
treeViewSetReorderable:: TreeViewClass tv => tv -> Bool -> IO ()
treeViewSetRulesHint:: TreeViewClass tv => tv -> Bool -> IO ()
treeViewSetVadjustment:: TreeViewClass tv => (Maybe Adjustment) -> tv -> IO ()

Introduction

The widget supports scrolling natively. This implies that pixel coordinates can be given in two formats: relative to the current view's upper left corner or relative to the whole list's coordinates. The former are called widget coordinates while the letter are called tree coordinates.

Todo

treeViewMoveColumnAfter and treeViewMoveColumnFirst are not dealt with in Mogul

gtk_tree_view_get_bin_window is to compare the GDK window from incoming events. We don't marshal that window parameter, so this function is not bound either.

All functions related to drag and drop are missing.

get_search_equal_func is missing: proper memory management is impossible

gtk_tree_view_set_destroy_count_func is not meant to be useful

expand-collapse-cursor-row needs to be bound if it is useful to expand and collapse rows in a user-defined manner. Would only work on Gtk 2.2 and higher since the return parameter changed

move_cursor, select_all, select_cursor_parent, select_cursor_row toggle_cursor_row, unselect_all are not bound. These functions are only useful to change the widgets behaviour for these actions. Everything else can be done with cursor_changed and columns_changed

set_scroll_adjustment makes sense if the user monitors the scroll bars *and* the scroll bars can be replaced anytime (the latter is odd) Let's hope this file will always only contain macros.

Datatypes

data Association

An abstract link between a store and a view. An abstract link between a store and a view.

data Association cr =Association [String]Int

data Renderer

data Renderer cr =Renderer crTreeViewColumn

type TreeViewColumnDropFunc

TreeViewColumnDropFuncFunPtr (((Ptr (TreeView)) -> ((Ptr (TreeViewColumn)) -> ((Ptr (TreeViewColumn)) -> ((Ptr (TreeViewColumn)) -> ((Ptr ()) -> (IO CInt)))))))

type TreeViewMappingFunc

TreeViewMappingFuncFunPtr (((Ptr (TreeView)) -> ((Ptr (TreePath)) -> ((Ptr ()) -> (IO ())))))

Constructors

treeViewNew

Make a new TreeView widget.

treeViewNew

treeViewNewWithModel

Create a new TreeView widget with tm as the storage model.

treeViewNewWithModel:: tm:: IO TreeView
tm

Methods

treeViewAppendColumn

Append a new column to the TreeView. Returns the new number of columns.

treeViewAppendColumn:: tv:: TreeViewColumn:: IO Int
tvtvc

treeViewCollapseAll

Collapse all nodes in the TreeView.

treeViewCollapseAll:: tv:: IO ()
tv

treeViewCollapseRow

Collapse a row. Returns True if the row existed.

treeViewCollapseRow:: tv:: TreePath:: IO Bool
tvpath

treeViewColumnAssociate

Create a link between the store and this model.

treeViewColumnAssociate:: Renderer r:: [Association r]:: IO ()
(Renderer ren tvc)assocs

The results are undefined, if this TreeViewColumn was not created with the same TreeModel as the Associations.

treeViewColumnNewPixbuf

Create a new renderer showing a ToggleButton.

treeViewColumnNewPixbuf:: TreeViewColumn:: Bool:: Bool:: IO (Renderer CellRendererPixbuf)
tvcatStartexpand

There can be several Renderer in each TreeViewColumn. Each Renderer can reflect several Attributes from a ListStore or TreeStore. Create a new renderer showing a Pixbuf.

There can be several Renderer in each TreeViewColumn. Each Renderer can reflect several Attributes from a ListStore or TreeStore.

treeViewColumnNewText

Create a new rederer showing text.

treeViewColumnNewText:: TreeViewColumn:: Bool:: Bool:: IO (Renderer CellRendererText)
tvcatStartexpand

There can be several Renderer in each TreeViewColumn. Each Renderer can reflect several Attributes from a ListStore or TreeStore.

treeViewColumnsAutosize

Resize the columns to their optimal size.

treeViewColumnsAutosize:: tv:: IO ()
tv

treeViewExpandAll

Expand all nodes in the TreeView.

treeViewExpandAll:: tv:: IO ()
tv

treeViewExpandRow

Expand a row.

treeViewExpandRow:: TreePath:: Bool:: tv:: IO Bool
pathalltv

Expand a node that is specified by path. If the all is True every child will be expanded recursively. Returns True if the row existed and had children.

treeViewExpandToPath

Make a certain path visible.

treeViewExpandToPath:: tv:: TreePath:: IO ()
tvtp

This will expand all parent rows of tp as necessary.

Only available in Gtk 2.2 and higher.

treeViewGetColumn

Retrieve a TreeViewColumn.

treeViewGetColumn:: tv:: Int:: IO (Maybe TreeViewColumn)
tvpos

Retrieve the pos th columns of TreeView. If the index is out of range Nothing is returned.

treeViewGetColumns

Return all TreeViewColumns in this TreeView.

treeViewGetColumns:: tv:: IO [TreeViewColumn]
tv

treeViewGetCursor

Retrieves the position of the focus.

treeViewGetCursor:: tv:: IO (Maybe TreePath,Maybe TreeViewColumn)
tv

Returns a pair (path, column).If the cursor is not currently set, path will be Nothing. If no column is currently selected, column will be Nothing.

treeViewGetExpanderColumn

Get location of hierarchy controls.

treeViewGetExpanderColumn:: tv:: IO TreeViewColumn
tv

Gets the column to draw the expander arrow at. If col is Nothing, then the expander arrow is always at the first visible column.

treeViewGetHadjustment

Get the Adjustment that represents the horizontal aspect.

treeViewGetHadjustment:: tv:: IO (Maybe Adjustment)
tv

treeViewGetHeadersVisible

Query if the column headers are visible.

treeViewGetHeadersVisible:: tv:: IO Bool
tv

treeViewGetModel

Retrieve the TreeModel that supplies the data for this TreeView. Returns Nothing if no model is currently set.

treeViewGetModel:: tv:: IO (Maybe TreeModel)
tv
no type info on symbol treeViewGetPathAtPos

treeViewGetReorderable

Query if rows can be moved around.

treeViewGetReorderable:: tv:: IO Bool
tv

See treeViewSetReorderable.

treeViewGetRulesHint

Give visual aid for wide columns.

treeViewGetRulesHint:: tv:: IO Bool
tv

This function tells GTK+ that the user interface for your application requires users to read across tree columns. By default, GTK+ will then render the tree with alternating row colors. Do not use it just because you prefer the appearance of the ruled tree; that's a question for the theme. Some themes will draw tree rows in alternating colors even when rules are turned off, and users who prefer that appearance all the time can choose those themes. You should call this function only as a semantic hint to the theme engine that your tree makes alternating colors useful from a functional standpoint (since it has lots of columns, generally).

treeViewGetSelection

Retrieve a TreeSelection that holds the current selected nodes of the View.

treeViewGetSelection:: tv:: IO TreeSelection
tv

treeViewGetVadjustment

Get the Adjustment that represents the vertical aspect.

treeViewGetVadjustment:: tv:: IO (Maybe Adjustment)
tv

treeViewInsertColumn

Inserts column tvc into the TreeView widget at the position pos. Returns the number of columns after insertion. Specify -1 for pos to insert the column at the end.

treeViewInsertColumn:: tv:: TreeViewColumn:: Int:: IO Int
tvtvcpos

treeViewInsertColumnWithAttributes

Insert new TreeViewColumn.

treeViewInsertColumnWithAttributes:: tv:: Int:: String:: cr:: [(String,Int)]:: IO ()
tvpostitlecrattribs

Inserts new column into the TreeView tv at position pos with title title, cell renderer cr and attributes attribs. Specify -1 for pos to insert the column at the end.

treeViewMapExpandedRows

Call function for every expaned row.

treeViewMapExpandedRows:: tv:: (TreePath -> IO ()):: IO ()
tvfunc

treeViewMoveColumnAfter

Move a specific column.

treeViewMoveColumnAfter:: tv:: TreeViewColumn:: TreeViewColumn:: IO ()
tvwhichafter

Use treeViewMoveColumnToFront if you want to move the column to the left end of the TreeView.

treeViewMoveColumnFirst

Move a specific column.

treeViewMoveColumnFirst:: tv:: TreeViewColumn:: IO ()
tvwhich

Use treeViewMoveColumnAfter if you want to move the column somewhere else than to the leftmost position.

treeViewRemoveColumn

Remove column tvc from the TreeView widget. The number of remaining columns is returned.

treeViewRemoveColumn:: tv:: TreeViewColumn:: IO Int
tvtvc

treeViewRowActivated

Emit the activated signal on a cell.

treeViewRowActivated:: tv:: TreePath:: TreeViewColumn:: IO ()
tvtptvc

treeViewRowExpanded

Check if row is expanded.

treeViewRowExpanded:: tv:: TreePath:: IO Bool
tvtp

treeViewScrollToCell

Scroll to a cell.

treeViewScrollToCell:: tv:: TreePath:: TreeViewColumn:: Maybe (Float,Float):: IO ()
tvpathtvcNothing
tvpathtvc(Just (ver, hor))

Scroll to a cell as specified by path and tvc. The cell is aligned within the TreeView widget as follows: horizontally by hor from left ( 0.0) to right ( 1.0) and vertically by ver from top ( 0.0) to buttom ( 1.0).

treeViewScrollToPoint

Scroll to a coordinate.

treeViewScrollToPoint:: tv:: Int:: Int:: IO ()
tvtreeXtreeY

Scrolls the tree view such that the top-left corner of the visible area is treeX, treeY, where treeX and treeY are specified in tree window coordinates. The TreeView must be realized before this function is called. If it isn't, you probably want to use treeViewScrollToCell.

treeViewSetColumnDragFunction

Specify where a column may be dropped.

treeViewSetColumnDragFunction:: tv:: Maybe (TreeViewColumn -> Maybe TreeViewColumn -> Maybe TreeViewColumn -> IO Bool):: IO ()
tv(Just pred)
tvNothing

Sets a user function for determining where a column may be dropped when dragged. This function is called on every column pair in turn at the beginning of a column drag to determine where a drop can take place.

The callback function take the TreeViewColumn to be moved, the second and third arguments are the columns on the left and right side of the new location. At most one of them might be Nothing which indicates that the column is about to be dropped at the left or right end of the TreeView.

The predicate pred should return True if it is ok to insert the column at this place.

Use Nothing for the predicate if columns can be inserted anywhere.

treeViewSetCursor

Selects a specific row.

treeViewSetCursor:: tv:: TreePath:: (Maybe (TreeViewColumn,Bool)):: IO ()
tvtp(Just (focusColumn, startEditing))
tvtpNothing

Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user's attention on a particular row. If focusColumn is given, then the input focus is given to the column specified by it. Additionally, if focusColumn is specified, and startEditing is True, then editing will be started in the specified cell. This function is often followed by a widgetGrabFocus to the TreeView in order to give keyboard focus to the widget.

treeViewSetCursorOnCell

Selects a cell in a specific row.

treeViewSetCursorOnCell:: tv:: TreePath:: TreeViewColumn:: CellRenderer:: Bool:: IO ()
tvtpfocusColumnfocusCellstartEditing

Similar to treeViewSetCursor but allows a column to containt several CellRenderers.

Only available in Gtk 2.2 and higher.

treeViewSetExpanderColumn

Set location of hierarchy controls.

treeViewSetExpanderColumn:: tv:: Maybe TreeViewColumn:: IO ()
tvNothing
tv(Just tvc)

Sets the column to draw the expander arrow at. If col is Nothing, then the expander arrow is always at the first visible column.

treeViewSetHadjustment

Set the Adjustment that controls the horizontal aspect. If adj is Nothing then set no Adjustment widget.

treeViewSetHadjustment:: (Maybe Adjustment):: tv:: IO ()
adjtv

treeViewSetHeadersClickable

Set wether the columns headers are sensitive to mouse clicks.

treeViewSetHeadersClickable:: tv:: Bool:: IO ()
tvclick

treeViewSetHeadersVisible

Set the visibility state of the column headers.

treeViewSetHeadersVisible:: tv:: Bool:: IO ()
tvvis

treeViewSetModel

Set the TreeModel for the current View.

treeViewSetModel:: tv:: tm:: IO ()
tvtm

treeViewSetReorderable

Check if rows can be moved around.

treeViewSetReorderable:: tv:: Bool:: IO ()
tvro

Set whether the user can use drag and drop (DND) to reorder the rows in the store. This works on both TreeStore and ListStore models. If ro is True, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model's signals. This function does not give you any degree of control over the order -- any reorderering is allowed. If more control is needed, you should probably handle drag and drop manually.

treeViewSetRulesHint

Query if visual aid for wide columns is turned on.

treeViewSetRulesHint:: tv:: Bool:: IO ()
tvvis

treeViewSetVadjustment

Set the Adjustment that controls the vertical aspect. If adj is Nothing then set no Adjustment widget.

treeViewSetVadjustment:: (Maybe Adjustment):: tv:: IO ()
adjtv