Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
A widget for displaying both trees and lists.
- data TreeView
- class ContainerClass o => TreeViewClass o
- castToTreeView :: GObjectClass obj => obj -> TreeView
- gTypeTreeView :: GType
- toTreeView :: TreeViewClass o => o -> TreeView
- type Point = (Int, Int)
- data DragAction
- data TreeViewGridLines
- treeViewNew :: IO TreeView
- treeViewNewWithModel :: TreeModelClass model => model -> IO TreeView
- treeViewGetModel :: TreeViewClass self => self -> IO (Maybe TreeModel)
- treeViewSetModel :: (TreeViewClass self, TreeModelClass model) => self -> model -> IO ()
- treeViewGetSelection :: TreeViewClass self => self -> IO TreeSelection
- treeViewGetHAdjustment :: TreeViewClass self => self -> IO (Maybe Adjustment)
- treeViewSetHAdjustment :: TreeViewClass self => self -> Maybe Adjustment -> IO ()
- treeViewGetVAdjustment :: TreeViewClass self => self -> IO (Maybe Adjustment)
- treeViewSetVAdjustment :: TreeViewClass self => self -> Maybe Adjustment -> IO ()
- treeViewGetHeadersVisible :: TreeViewClass self => self -> IO Bool
- treeViewSetHeadersVisible :: TreeViewClass self => self -> Bool -> IO ()
- treeViewColumnsAutosize :: TreeViewClass self => self -> IO ()
- treeViewSetHeadersClickable :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetRulesHint :: TreeViewClass self => self -> IO Bool
- treeViewSetRulesHint :: TreeViewClass self => self -> Bool -> IO ()
- treeViewAppendColumn :: TreeViewClass self => self -> TreeViewColumn -> IO Int
- treeViewRemoveColumn :: TreeViewClass self => self -> TreeViewColumn -> IO Int
- treeViewInsertColumn :: TreeViewClass self => self -> TreeViewColumn -> Int -> IO Int
- treeViewGetColumn :: TreeViewClass self => self -> Int -> IO (Maybe TreeViewColumn)
- treeViewGetColumns :: TreeViewClass self => self -> IO [TreeViewColumn]
- treeViewMoveColumnAfter :: TreeViewClass self => self -> TreeViewColumn -> TreeViewColumn -> IO ()
- treeViewMoveColumnFirst :: TreeViewClass self => self -> TreeViewColumn -> IO ()
- treeViewSetExpanderColumn :: TreeViewClass self => self -> Maybe TreeViewColumn -> IO ()
- treeViewGetExpanderColumn :: TreeViewClass self => self -> IO TreeViewColumn
- treeViewSetColumnDragFunction :: TreeViewClass self => self -> Maybe (TreeViewColumn -> Maybe TreeViewColumn -> Maybe TreeViewColumn -> IO Bool) -> IO ()
- treeViewScrollToPoint :: TreeViewClass self => self -> Int -> Int -> IO ()
- treeViewScrollToCell :: TreeViewClass self => self -> Maybe TreePath -> Maybe TreeViewColumn -> Maybe (Float, Float) -> IO ()
- treeViewSetCursor :: TreeViewClass self => self -> TreePath -> Maybe (TreeViewColumn, Bool) -> IO ()
- treeViewSetCursorOnCell :: (TreeViewClass self, CellRendererClass focusCell) => self -> TreePath -> TreeViewColumn -> focusCell -> Bool -> IO ()
- treeViewGetCursor :: TreeViewClass self => self -> IO (TreePath, Maybe TreeViewColumn)
- treeViewRowActivated :: TreeViewClass self => self -> TreePath -> TreeViewColumn -> IO ()
- treeViewExpandAll :: TreeViewClass self => self -> IO ()
- treeViewCollapseAll :: TreeViewClass self => self -> IO ()
- treeViewExpandToPath :: TreeViewClass self => self -> TreePath -> IO ()
- treeViewExpandRow :: TreeViewClass self => self -> TreePath -> Bool -> IO Bool
- treeViewCollapseRow :: TreeViewClass self => self -> TreePath -> IO Bool
- treeViewMapExpandedRows :: TreeViewClass self => self -> (TreePath -> IO ()) -> IO ()
- treeViewRowExpanded :: TreeViewClass self => self -> TreePath -> IO Bool
- treeViewGetReorderable :: TreeViewClass self => self -> IO Bool
- treeViewSetReorderable :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetPathAtPos :: TreeViewClass self => self -> Point -> IO (Maybe (TreePath, TreeViewColumn, Point))
- treeViewGetCellArea :: TreeViewClass self => self -> Maybe TreePath -> TreeViewColumn -> IO Rectangle
- treeViewGetBackgroundArea :: TreeViewClass self => self -> Maybe TreePath -> TreeViewColumn -> IO Rectangle
- treeViewGetVisibleRect :: TreeViewClass self => self -> IO Rectangle
- treeViewConvertBinWindowToTreeCoords :: TreeViewClass self => self -> Point -> IO Point
- treeViewConvertBinWindowToWidgetCoords :: TreeViewClass self => self -> Point -> IO Point
- treeViewConvertTreeToBinWindowCoords :: TreeViewClass self => self -> Point -> IO Point
- treeViewConvertTreeToWidgetCoords :: TreeViewClass self => self -> Point -> IO Point
- treeViewConvertWidgetToBinWindowCoords :: TreeViewClass self => self -> Point -> IO Point
- treeViewConvertWidgetToTreeCoords :: TreeViewClass self => self -> Point -> IO Point
- treeViewGetEnableSearch :: TreeViewClass self => self -> IO Bool
- treeViewSetEnableSearch :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetSearchColumn :: (TreeViewClass self, GlibString string) => self -> IO (ColumnId row string)
- treeViewSetSearchColumn :: (TreeViewClass self, GlibString string) => self -> ColumnId row string -> IO ()
- treeViewSetSearchEqualFunc :: (TreeViewClass self, GlibString string) => self -> Maybe (string -> TreeIter -> IO Bool) -> IO ()
- treeViewGetFixedHeightMode :: TreeViewClass self => self -> IO Bool
- treeViewSetFixedHeightMode :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetHoverSelection :: TreeViewClass self => self -> IO Bool
- treeViewSetHoverSelection :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetHoverExpand :: TreeViewClass self => self -> IO Bool
- treeViewSetHoverExpand :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetHeadersClickable :: TreeViewClass self => self -> IO Bool
- treeViewGetVisibleRange :: TreeViewClass self => self -> IO (TreePath, TreePath)
- treeViewEnableModelDragDest :: TreeViewClass self => self -> TargetList -> [DragAction] -> IO ()
- treeViewEnableModelDragSource :: TreeViewClass self => self -> [Modifier] -> TargetList -> [DragAction] -> IO ()
- treeViewUnsetRowsDragSource :: TreeViewClass self => self -> IO ()
- treeViewUnsetRowsDragDest :: TreeViewClass self => self -> IO ()
- treeViewGetSearchEntry :: TreeViewClass self => self -> IO (Maybe Entry)
- treeViewSetSearchEntry :: (TreeViewClass self, EntryClass entry) => self -> Maybe entry -> IO ()
- treeViewSetRowSeparatorFunc :: TreeViewClass self => self -> Maybe (TreeIter -> IO Bool) -> IO ()
- treeViewGetRubberBanding :: TreeViewClass self => self -> IO Bool
- treeViewSetRubberBanding :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetEnableTreeLines :: TreeViewClass self => self -> IO Bool
- treeViewSetEnableTreeLines :: TreeViewClass self => self -> Bool -> IO ()
- treeViewGetGridLines :: TreeViewClass self => self -> IO TreeViewGridLines
- treeViewSetGridLines :: TreeViewClass self => self -> TreeViewGridLines -> IO ()
- treeViewSetTooltipRow :: TreeViewClass self => self -> Tooltip -> TreePath -> IO ()
- treeViewSetTooltipCell :: (TreeViewClass self, TreeViewColumnClass col, CellRendererClass renderer) => self -> Tooltip -> Maybe TreePath -> Maybe col -> Maybe renderer -> IO ()
- treeViewGetTooltipContext :: TreeViewClass self => self -> Maybe Point -> IO (Maybe TreeIter)
- treeViewModel :: (TreeViewClass self, TreeModelClass model) => ReadWriteAttr self (Maybe TreeModel) model
- treeViewHAdjustment :: TreeViewClass self => Attr self (Maybe Adjustment)
- treeViewVAdjustment :: TreeViewClass self => Attr self (Maybe Adjustment)
- treeViewHeadersVisible :: TreeViewClass self => Attr self Bool
- treeViewHeadersClickable :: TreeViewClass self => Attr self Bool
- treeViewExpanderColumn :: TreeViewClass self => ReadWriteAttr self TreeViewColumn (Maybe TreeViewColumn)
- treeViewReorderable :: TreeViewClass self => Attr self Bool
- treeViewRulesHint :: TreeViewClass self => Attr self Bool
- treeViewEnableSearch :: TreeViewClass self => Attr self Bool
- treeViewSearchColumn :: (TreeViewClass self, GlibString string) => Attr self (ColumnId row string)
- treeViewFixedHeightMode :: TreeViewClass self => Attr self Bool
- treeViewHoverSelection :: TreeViewClass self => Attr self Bool
- treeViewHoverExpand :: TreeViewClass self => Attr self Bool
- treeViewShowExpanders :: TreeViewClass self => Attr self Bool
- treeViewLevelIndentation :: TreeViewClass self => Attr self Int
- treeViewRubberBanding :: TreeViewClass self => Attr self Bool
- treeViewEnableGridLines :: TreeViewClass self => Attr self TreeViewGridLines
- treeViewEnableTreeLines :: TreeViewClass self => Attr self Bool
- treeViewGridLines :: TreeViewClass self => Attr self TreeViewGridLines
- treeViewSearchEntry :: (TreeViewClass self, EntryClass entry) => ReadWriteAttr self (Maybe Entry) (Maybe entry)
- treeViewTooltipColumn :: (TreeViewClass self, GlibString string) => Attr self (ColumnId row string)
- columnsChanged :: TreeViewClass self => Signal self (IO ())
- cursorChanged :: TreeViewClass self => Signal self (IO ())
- rowCollapsed :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO ())
- rowExpanded :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO ())
- rowActivated :: TreeViewClass self => Signal self (TreePath -> TreeViewColumn -> IO ())
- testCollapseRow :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO Bool)
- testExpandRow :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO Bool)
Description
Widget that displays any object that implements the TreeModel
interface.
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.
Class Hierarchy
Types
class ContainerClass o => TreeViewClass o Source
castToTreeView :: GObjectClass obj => obj -> TreeView Source
toTreeView :: TreeViewClass o => o -> TreeView Source
data DragAction Source
data TreeViewGridLines Source
Grid lines.
Constructors
treeViewNew :: IO TreeView Source
Creates a new TreeView
widget.
treeViewNewWithModel :: TreeModelClass model => model -> IO TreeView Source
Create a new TreeView
widget with model
as the storage model.
Methods
treeViewGetModel :: TreeViewClass self => self -> IO (Maybe TreeModel) Source
Returns the model that supplies the data for
this TreeView
. Returns Nothing
if the model is unset.
treeViewSetModel :: (TreeViewClass self, TreeModelClass model) => self -> model -> IO () Source
Set the TreeModel
for the current View.
treeViewGetSelection :: TreeViewClass self => self -> IO TreeSelection Source
Retrieve a TreeSelection
that
holds the current selected nodes of the View.
treeViewGetHAdjustment :: TreeViewClass self => self -> IO (Maybe Adjustment) Source
Gets the Adjustment
currently being used for the horizontal aspect.
:: TreeViewClass self | |
=> self | |
-> Maybe Adjustment |
|
-> IO () |
Sets the Adjustment
for the current horizontal aspect.
treeViewGetVAdjustment :: TreeViewClass self => self -> IO (Maybe Adjustment) Source
Gets the Adjustment
currently being used for the vertical aspect.
:: TreeViewClass self | |
=> self | |
-> Maybe Adjustment |
|
-> IO () |
Sets the Adjustment
for the current vertical aspect.
treeViewGetHeadersVisible :: TreeViewClass self => self -> IO Bool Source
Query if the column headers are visible.
treeViewSetHeadersVisible :: TreeViewClass self => self -> Bool -> IO () Source
Set the visibility state of the column headers.
treeViewColumnsAutosize :: TreeViewClass self => self -> IO () Source
Resize the columns to their optimal size.
treeViewSetHeadersClickable :: TreeViewClass self => self -> Bool -> IO () Source
Set wether the columns headers are sensitive to mouse clicks.
treeViewGetRulesHint :: TreeViewClass self => self -> IO Bool Source
Query if visual aid for wide columns is turned on.
treeViewSetRulesHint :: TreeViewClass self => self -> Bool -> IO () Source
This function tells Gtk+ that the user interface for your application requires users to read across tree rows and associate cells with one another. 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).
treeViewAppendColumn :: TreeViewClass self => self -> TreeViewColumn -> IO Int Source
Append a new column to the TreeView
. Returns the new number of columns.
treeViewRemoveColumn :: TreeViewClass self => self -> TreeViewColumn -> IO Int Source
Remove column tvc
from the TreeView
widget. The number of remaining columns is returned.
treeViewInsertColumn :: TreeViewClass self => self -> TreeViewColumn -> Int -> IO Int Source
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.
treeViewGetColumn :: TreeViewClass self => self -> Int -> IO (Maybe TreeViewColumn) Source
Retrieve a TreeViewColumn
.
- Retrieve the
pos
th columns ofTreeView
. If the index is out of range Nothing is returned.
treeViewGetColumns :: TreeViewClass self => self -> IO [TreeViewColumn] Source
Return all TreeViewColumn
s in this TreeView
.
treeViewMoveColumnAfter :: TreeViewClass self => self -> TreeViewColumn -> TreeViewColumn -> IO () Source
Move a specific column.
- Use
treeViewMoveColumnToFront
if you want to move the column to the left end of theTreeView
.
treeViewMoveColumnFirst :: TreeViewClass self => self -> TreeViewColumn -> IO () Source
Move a specific column.
- Use
treeViewMoveColumnAfter
if you want to move the column somewhere else than to the leftmost position.
treeViewSetExpanderColumn :: TreeViewClass self => self -> Maybe TreeViewColumn -> IO () Source
Set location of hierarchy controls.
- Sets the column to draw the expander arrow at. If
col
isNothing
, then the expander arrow is always at the first visible column.
If you do not want expander arrow to appear in your tree, set the expander column to a hidden column.
treeViewGetExpanderColumn :: TreeViewClass self => self -> IO TreeViewColumn Source
Get location of hierarchy controls.
- Gets the column to draw the expander arrow at. If
col
isNothing
, then the expander arrow is always at the first visible column.
treeViewSetColumnDragFunction :: TreeViewClass self => self -> Maybe (TreeViewColumn -> Maybe TreeViewColumn -> Maybe TreeViewColumn -> IO Bool) -> IO () Source
Specify where a column may be dropped.
- 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 beNothing
which indicates that the column is about to be dropped at the left or right end of theTreeView
. - The predicate
pred
should returnTrue
if it is ok to insert the column at this place. - Use
Nothing
for the predicate if columns can be inserted anywhere.
treeViewScrollToPoint :: TreeViewClass self => self -> Int -> Int -> IO () Source
Scroll to a coordinate.
- Scrolls the tree view such that the top-left corner of the
visible area is
treeX
,treeY
, wheretreeX
andtreeY
are specified in tree window coordinates. TheTreeView
must be realized before this function is called. If it isn't, you probably want to usetreeViewScrollToCell
.
treeViewScrollToCell :: TreeViewClass self => self -> Maybe TreePath -> Maybe TreeViewColumn -> Maybe (Float, Float) -> IO () Source
Scroll to a cell.
Moves the alignments of tree_view to the position specified by mbColumn and mbPath.
If mbColumn is Nothing, then no horizontal scrolling occurs. Likewise, if mbPath
is Nothing no vertical scrolling occurs. At a minimum, one of mbColumn or mbPath
need to be provided. rowAlign
determines where the row is placed, and
colAlign
determines where column is placed. Both are expected to be between
0.0 and 1.0. 0.0 means lefttop alignment, 1.0 means rightbottom alignment,
0.5 means center.
If Nothing is passed instead of rowAlign
and colAlign
, then the tree does
the minimum amount of work to scroll the cell onto the screen. This means
that the cell will be scrolled to the edge closest to its current position.
If the cell is currently visible on the screen, nothing is done.
This function only works if the model is set, and path is a valid row on the model. If the model changes before the tree_view is realized, the centered path will be modified to reflect this change.
treeViewSetCursor :: TreeViewClass self => self -> TreePath -> Maybe (TreeViewColumn, Bool) -> IO () Source
Selects a specific row.
- 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. IffocusColumn
is given, then the input focus is given to the column specified by it. Additionally, iffocusColumn
is specified, andstartEditing
isTrue
, then editing will be started in the specified cell. This function is often followed by awidgetGrabFocus
to theTreeView
in order to give keyboard focus to the widget.
treeViewSetCursorOnCell :: (TreeViewClass self, CellRendererClass focusCell) => self -> TreePath -> TreeViewColumn -> focusCell -> Bool -> IO () Source
Selects a cell in a specific row.
- Similar to
treeViewSetCursor
but allows a column to containt severalCellRenderer
s. - Only available in Gtk 2.2 and higher.
treeViewGetCursor :: TreeViewClass self => self -> IO (TreePath, Maybe TreeViewColumn) Source
Retrieves the position of the focus.
- Returns a pair
(path, column)
.If the cursor is not currently set,path
will be[]
. If no column is currently selected,column
will beNothing
.
treeViewRowActivated :: TreeViewClass self => self -> TreePath -> TreeViewColumn -> IO () Source
Emit the activated signal on a cell.
treeViewExpandAll :: TreeViewClass self => self -> IO () Source
Recursively expands all nodes in the tree view.
treeViewCollapseAll :: TreeViewClass self => self -> IO () Source
Recursively collapses all visible, expanded nodes in the tree view.
treeViewExpandToPath :: TreeViewClass self => self -> TreePath -> IO () Source
Make a certain path visible.
- This will expand all parent rows of
tp
as necessary. - Only available in Gtk 2.2 and higher.
:: TreeViewClass self | |
=> self | |
-> TreePath |
|
-> Bool |
|
-> IO Bool | returns |
Opens the row so its children are visible.
:: TreeViewClass self | |
=> self | |
-> TreePath |
|
-> IO Bool | returns |
Collapses a row (hides its child rows, if they exist).
treeViewMapExpandedRows :: TreeViewClass self => self -> (TreePath -> IO ()) -> IO () Source
Call function for every expaned row.
:: TreeViewClass self | |
=> self | |
-> TreePath |
|
-> IO Bool | returns |
Check if row is expanded.
treeViewGetReorderable :: TreeViewClass self => self -> IO Bool Source
Query if rows can be moved around.
treeViewSetReorderable :: TreeViewClass self => self -> Bool -> IO () Source
Check if rows can be moved around.
- Set whether the user can use drag and drop (DND) to reorder the rows in
the store. This works on both
TreeStore
andListStore
models. Ifro
isTrue
, 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. If you need to control which rows may be dragged or where rows may be dropped, you can override thetreeDragSourceRowDraggable
function in the default DND implementation of the model.
treeViewGetPathAtPos :: TreeViewClass self => self -> Point -> IO (Maybe (TreePath, TreeViewColumn, Point)) Source
Map a pixel to the specific cell.
- Finds the path at the
Point
(x, y)
. The coordinatesx
andy
are relative to the top left corner of theTreeView
drawing window. As such, coordinates in a mouse click event can be used directly to determine the cell which the user clicked on. This function is useful to realize popup menus. - The returned point is the input point relative to the cell's upper
left corner. The whole
TreeView
is divided between all cells. The returned point is relative to the rectangle this cell occupies within theTreeView
.
treeViewGetCellArea :: TreeViewClass self => self -> Maybe TreePath -> TreeViewColumn -> IO Rectangle Source
Retrieve the smallest bounding box of a cell.
- Fills the bounding rectangle in tree window coordinates for the
cell at the row specified by
tp
and the column specified bytvc
. Ifpath
isNothing
or points to a path not currently displayed, they
andheight
fields of theRectangle
will be filled with0
. The sum of all cell rectangles does not cover the entire tree; there are extra pixels in between rows, for example.
treeViewGetBackgroundArea :: TreeViewClass self => self -> Maybe TreePath -> TreeViewColumn -> IO Rectangle Source
Retrieve the largest bounding box of a cell.
- Fills the bounding rectangle in tree window coordinates for the
cell at the row specified by
tp
and the column specified bytvc
. Ifpath
isNothing
or points to a path not currently displayed, they
andheight
fields of theRectangle
will be filled with0
. The background areas tile the widget's area to cover the entire tree window (except for the area used for header buttons). Contrast this withtreeViewGetCellArea
.
treeViewGetVisibleRect :: TreeViewClass self => self -> IO Rectangle Source
Retrieve the currently visible area.
- The returned rectangle gives the visible part of the tree in tree coordinates.
treeViewConvertBinWindowToTreeCoords Source
:: TreeViewClass self | |
=> self | |
-> Point |
|
-> IO Point |
|
Converts bin window coordinates to coordinates for the tree (the full scrollable area of the tree).
treeViewConvertBinWindowToWidgetCoords Source
:: TreeViewClass self | |
=> self | |
-> Point |
|
-> IO Point |
|
Converts bin window coordinates (see treeViewGetBinWindow
to widget relative coordinates.
treeViewConvertTreeToBinWindowCoords Source
:: TreeViewClass self | |
=> self | |
-> Point |
|
-> IO Point |
|
Converts tree coordinates (coordinates in full scrollable area of the tree) to bin window coordinates.
treeViewConvertTreeToWidgetCoords Source
:: TreeViewClass self | |
=> self | |
-> Point |
|
-> IO Point |
|
Converts tree coordinates (coordinates in full scrollable area of the tree) to widget coordinates.
treeViewConvertWidgetToBinWindowCoords Source
:: TreeViewClass self | |
=> self | |
-> Point |
|
-> IO Point |
|
Converts widget coordinates to coordinates for the window (see treeViewGetBinWindow
).
treeViewConvertWidgetToTreeCoords Source
:: TreeViewClass self | |
=> self | |
-> Point |
|
-> IO Point |
|
Converts widget coordinates to coordinates for the tree (the full scrollable area of the tree).
treeViewGetEnableSearch :: TreeViewClass self => self -> IO Bool Source
Returns whether or not the tree allows to start interactive searching by typing in text.
- If enabled, the user can type in text which will set the cursor to the first matching entry.
treeViewSetEnableSearch :: TreeViewClass self => self -> Bool -> IO () Source
If this is set, then the user can type in text to search through the tree interactively (this is sometimes called "typeahead find").
Note that even if this is False
, the user can still initiate a search
using the "start-interactive-search" key binding. In any case,
a predicate that compares a row of the model with the text the user
has typed must be set using treeViewSetSearchEqualFunc
.
treeViewGetSearchColumn Source
:: (TreeViewClass self, GlibString string) | |
=> self | |
-> IO (ColumnId row string) | returns the column the interactive search code searches in. |
Gets the column searched on by the interactive search code.
treeViewSetSearchColumn Source
:: (TreeViewClass self, GlibString string) | |
=> self | |
-> ColumnId row string |
|
-> IO () |
Sets column
as the column where the interactive search code should
search in.
If the sort column is set, users can use the "start-interactive-search" key binding to bring up search popup. The enable-search property controls whether simply typing text will also start an interactive search.
Note that column
refers to a column of the model. Furthermore, the
search column is not used if a comparison function is set, see
treeViewSetSearchEqualFunc
.
treeViewSetSearchEqualFunc :: (TreeViewClass self, GlibString string) => self -> Maybe (string -> TreeIter -> IO Bool) -> IO () Source
Set the predicate to test for equality.
- The predicate must returns
True
if the text entered by the user and the row of the model match. Calling this function will overwrite thetreeViewSearchColumn
(which isn't used anyway when a comparison function is installed).
treeViewGetFixedHeightMode Source
:: TreeViewClass self | |
=> self | |
-> IO Bool | returns |
Returns whether fixed height mode is turned on for the tree view.
- Available since Gtk+ version 2.6
treeViewSetFixedHeightMode Source
:: TreeViewClass self | |
=> self | |
-> Bool |
|
-> IO () |
Enables or disables the fixed height mode of the tree view. Fixed height
mode speeds up TreeView
by assuming that all rows have the same height.
Only enable this option if all rows are the same height and all columns are
of type TreeViewColumnFixed
.
- Available since Gtk+ version 2.6
treeViewGetHoverSelection Source
:: TreeViewClass self | |
=> self | |
-> IO Bool | returns |
Returns whether hover selection mode is turned on for treeView
.
- Available since Gtk+ version 2.6
treeViewSetHoverSelection Source
:: TreeViewClass self | |
=> self | |
-> Bool |
|
-> IO () |
Enables of disables the hover selection mode of the tree view. Hover
selection makes the selected row follow the pointer. Currently, this works
only for the selection modes SelectionSingle
and SelectionBrowse
.
- Available since Gtk+ version 2.6
:: TreeViewClass self | |
=> self | |
-> IO Bool | returns |
Returns whether hover expansion mode is turned on for the tree view.
- Available since Gtk+ version 2.6
:: TreeViewClass self | |
=> self | |
-> Bool |
|
-> IO () |
Enables of disables the hover expansion mode of the tree view. Hover expansion makes rows expand or collaps if the pointer moves over them.
- Available since Gtk+ version 2.6
treeViewGetHeadersClickable Source
:: TreeViewClass self | |
=> self | |
-> IO Bool | returns |
Returns whether all header columns are clickable.
- Available since Gtk+ version 2.10
treeViewGetVisibleRange Source
:: TreeViewClass self | |
=> self | |
-> IO (TreePath, TreePath) | the first and the last node that is visible |
Return the first and last visible path. Note that there may be invisible paths in between.
- Available since Gtk+ version 2.8
treeViewEnableModelDragDest Source
:: TreeViewClass self | |
=> self | |
-> TargetList |
|
-> [DragAction] |
|
-> IO () |
Turns treeView
into a drop destination for automatic DND.
treeViewEnableModelDragSource Source
:: TreeViewClass self | |
=> self | |
-> [Modifier] |
|
-> TargetList |
|
-> [DragAction] |
|
-> IO () |
Turns treeView
into a drag source for automatic DND.
treeViewUnsetRowsDragSource :: TreeViewClass self => self -> IO () Source
Undoes the effect of treeViewEnableModelDragSource
.
treeViewUnsetRowsDragDest :: TreeViewClass self => self -> IO () Source
Undoes the effect of treeViewEnableModelDragDest
.
:: TreeViewClass self | |
=> self | |
-> IO (Maybe Entry) | returns the entry currently in use as search entry. |
Returns the Entry
which is currently in use as interactive search entry
for treeView
. In case the built-in entry is being used, Nothing
will be
returned.
- Available since Gtk+ version 2.10
:: (TreeViewClass self, EntryClass entry) | |
=> self | |
-> Maybe entry |
|
-> IO () |
Sets the entry which the interactive search code will use for this
treeView
. This is useful when you want to provide a search entry in our
interface at all time at a fixed position. Passing Nothing
for entry
will make the interactive search code use the built-in popup entry again.
- Available since Gtk+ version 2.10
treeViewSetRowSeparatorFunc Source
:: TreeViewClass self | |
=> self | |
-> Maybe (TreeIter -> IO Bool) |
|
-> IO () |
Sets the row separator function, which is used to determine whether a row
should be drawn as a separator. If the row separator function is Nothing
,
no separators are drawn. This is the default value.
- Available since Gtk+ version 2.6
treeViewGetRubberBanding Source
:: TreeViewClass self | |
=> self | |
-> IO Bool | returns |
Returns whether rubber banding is turned on for treeView
. If the
selection mode is SelectionMultiple
, rubber banding will allow the user to
select multiple rows by dragging the mouse.
- Available since Gtk+ version 2.10
treeViewSetRubberBanding Source
:: TreeViewClass self | |
=> self | |
-> Bool |
|
-> IO () |
Enables or disables rubber banding in treeView
. If the selection mode
is SelectionMultiple
, rubber banding will allow the user to select
multiple rows by dragging the mouse.
- Available since Gtk+ version 2.10
treeViewGetEnableTreeLines Source
:: TreeViewClass self | |
=> self | |
-> IO Bool | returns |
Returns whether or not tree lines are drawn in treeView
.
- Available since Gtk+ version 2.10
treeViewSetEnableTreeLines Source
:: TreeViewClass self | |
=> self | |
-> Bool |
|
-> IO () |
Sets whether to draw lines interconnecting the expanders in treeView
.
This does not have any visible effects for lists.
- Available since Gtk+ version 2.10
:: TreeViewClass self | |
=> self | |
-> IO TreeViewGridLines | returns a |
Returns which grid lines are enabled in treeView
.
- Available since Gtk+ version 2.10
:: TreeViewClass self | |
=> self | |
-> TreeViewGridLines |
|
-> IO () |
Sets which grid lines to draw in treeView
.
- Available since Gtk+ version 2.10
:: TreeViewClass self | |
=> self | |
-> Tooltip | the |
-> TreePath |
|
-> IO () |
Sets the tip area of tooltip
to be the area covered by path
. See also
treeViewTooltipColumn
for a simpler alternative. See also
tooltipSetTipArea
.
:: (TreeViewClass self, TreeViewColumnClass col, CellRendererClass renderer) | |
=> self | |
-> Tooltip | the |
-> Maybe TreePath |
|
-> Maybe col |
|
-> Maybe renderer | the |
-> IO () |
Sets the tip area of tooltip to the area path, column and cell have in
common. For example if path
is Nothing
and column
is set, the tip area will be
set to the full area covered by column. See also
tooltipSetTipArea
. Note that if path
is not specified and cell
is
set and part of a column containing the expander, the tooltip might not
show and hide at the correct position. In such cases path
must be set to
the current node under the mouse cursor for this function to operate
correctly. See also treeViewTooltipColumn
for a simpler alternative.
treeViewGetTooltipContext Source
:: TreeViewClass self | |
=> self | |
-> Maybe Point |
|
-> IO (Maybe TreeIter) |
|
This function is supposed to be used in a widgetQueryTooltip
signal handler
for this TreeView
. The point
value which is received in the
signal handler should be passed to this function without modification. A
return value of Just iter
indicates that there is a tree view row at the given
coordinates (if Just (x,y)
is passed in, denoting a mouse position), resp.
the cursor row (if Nothing
is passed in, denoting a keyboard request).
Attributes
treeViewModel :: (TreeViewClass self, TreeModelClass model) => ReadWriteAttr self (Maybe TreeModel) model Source
The model for the tree view.
treeViewHAdjustment :: TreeViewClass self => Attr self (Maybe Adjustment) Source
Horizontal Adjustment for the widget.
treeViewVAdjustment :: TreeViewClass self => Attr self (Maybe Adjustment) Source
Vertical Adjustment for the widget.
treeViewHeadersVisible :: TreeViewClass self => Attr self Bool Source
Show the column header buttons.
Default value: True
treeViewHeadersClickable :: TreeViewClass self => Attr self Bool Source
Column headers respond to click events.
Default value: False
treeViewExpanderColumn :: TreeViewClass self => ReadWriteAttr self TreeViewColumn (Maybe TreeViewColumn) Source
Set the column for the expander column.
treeViewReorderable :: TreeViewClass self => Attr self Bool Source
View is reorderable.
Default value: False
treeViewRulesHint :: TreeViewClass self => Attr self Bool Source
Set a hint to the theme engine to draw rows in alternating colors.
Default value: False
treeViewEnableSearch :: TreeViewClass self => Attr self Bool Source
View allows user to search through columns interactively.
Default value: True
treeViewSearchColumn :: (TreeViewClass self, GlibString string) => Attr self (ColumnId row string) Source
Model column to search through when searching through code.
Default value: invalidColumnId
treeViewFixedHeightMode :: TreeViewClass self => Attr self Bool Source
Setting the treeViewFixedHeightMode
property to True
speeds up TreeView
by assuming that all rows have the same height. Only enable this option if
all rows are the same height. Please see treeViewSetFixedHeightMode
for
more information on this option.
Default value: False
- Available since Gtk+ version 2.4
treeViewHoverSelection :: TreeViewClass self => Attr self Bool Source
Enables of disables the hover selection mode of treeView
. Hover
selection makes the selected row follow the pointer. Currently, this works
only for the selection modes SelectionSingle
and SelectionBrowse
.
This mode is primarily intended for TreeView
s in popups, e.g. in
ComboBox
or EntryCompletion
.
Default value: False
- Available since Gtk+ version 2.6
treeViewHoverExpand :: TreeViewClass self => Attr self Bool Source
Enables of disables the hover expansion mode of treeView
. Hover
expansion makes rows expand or collaps if the pointer moves over them.
This mode is primarily intended for TreeView
s in popups, e.g. in
ComboBox
or EntryCompletion
.
Default value: False
- Available since Gtk+ version 2.6
treeViewShowExpanders :: TreeViewClass self => Attr self Bool Source
View has expanders.
Default value: True
treeViewLevelIndentation :: TreeViewClass self => Attr self Int Source
Extra indentation for each level.
Allowed values: >= 0
Default value: 0
treeViewRubberBanding :: TreeViewClass self => Attr self Bool Source
Whether to enable selection of multiple items by dragging the mouse pointer.
Default value: False
treeViewEnableGridLines :: TreeViewClass self => Attr self TreeViewGridLines Source
Whether grid lines should be drawn in the tree view.
Default value: TreeViewGridLinesNone
treeViewEnableTreeLines :: TreeViewClass self => Attr self Bool Source
Whether tree lines should be drawn in the tree view.
Default value: False
treeViewGridLines :: TreeViewClass self => Attr self TreeViewGridLines Source
'gridLines' property. See treeViewGetGridLines
and
treeViewSetGridLines
treeViewSearchEntry :: (TreeViewClass self, EntryClass entry) => ReadWriteAttr self (Maybe Entry) (Maybe entry) Source
'searchEntry' property. See treeViewGetSearchEntry
and
treeViewSetSearchEntry
treeViewTooltipColumn :: (TreeViewClass self, GlibString string) => Attr self (ColumnId row string) Source
The column for which to show tooltips.
If you only plan to have simple (text-only) tooltips on full rows, you can
use this function to have TreeView
handle these automatically for you.
column
should be set to a column in model containing the tooltip texts,
or -1
to disable this feature. When enabled, widgetHasTooltip
will be
set to True
and this view will connect to the widgetQueryTooltip
signal
handler.
Note that the signal handler sets the text as Markup
,
so &, <, etc have to be escaped in the text.
Default value: invalidColumnId
Signals
columnsChanged :: TreeViewClass self => Signal self (IO ()) Source
The number of columns of the treeview has changed.
cursorChanged :: TreeViewClass self => Signal self (IO ()) Source
The position of the cursor (focused cell) has changed.
rowCollapsed :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO ()) Source
The given row has been collapsed (child nodes are hidden).
rowExpanded :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO ()) Source
The given row has been expanded (child nodes are shown).
rowActivated :: TreeViewClass self => Signal self (TreePath -> TreeViewColumn -> IO ()) Source
A row was activated.
- Activation usually means the user has pressed return on a row.
testCollapseRow :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO Bool) Source
The given row is about to be collapsed (hide its children nodes). Use this signal if you need to control the collapsibility of individual rows.
testExpandRow :: TreeViewClass self => Signal self (TreeIter -> TreePath -> IO Bool) Source
The given row is about to be expanded (show its children nodes). Use this signal if you need to control the expandability of individual rows.