| gtk-0.11.0: Binding to the Gtk+ graphical user interface library. | Contents | Index |
|
Graphics.UI.Gtk.ModelView.TreeSortable | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
The interface for sortable models used by TreeView
|
|
Synopsis |
|
|
|
|
Detail
|
|
TreeSortable is an interface to be implemented by tree models which
support sorting. The TreeView uses the methods provided by this interface
to sort the model. As of now, only the
Graphics.UI.Gtk.ModelView.TreeModelSort.TreeModelSort proxy supports the
sortable interface. Thus, in order to enable sortable columns in a
TreeView, it is necessary to wrap a
Graphics.UI.Gtk.ModelView.ListStore.ListStore or
Graphics.UI.Gtk.ModelView.TreeStore.TreeStore model in a
Graphics.UI.Gtk.ModelView.TreeModelSort.TreeModelSort.
A Graphics.UI.Gtk.ModelView.TreeViewColumn can be sorted by the user
though clicking into the column's header. The rows in the view will then be
sorted by the sorting function set for that column. Specifically, a set of
sorting functions must be set using the interface provided in this module.
Each sorting function is associated with a SortColumnId, which is some
positive number. A tree view column is then associated with the sorting
function by passing the SortColumnId to
Graphics.UI.Gtk.ModelView.TreeViewColumn.treeViewColumnSetSortColumnId.
There exists one special SortColumnId, namely
treeSortableDefaultSortColumnId for which a default sorting function can
be set. If no such function is set, the order of the rows is the order in
which they are stored in the model.
|
|
Class Hierarchy
|
|
| GInterface
| +----TreeSortable
|
|
Types
|
|
data TreeSortable |
Instances | |
|
|
class GObjectClass o => TreeSortableClass o |
| Instances | |
|
|
castToTreeSortable :: GObjectClass obj => obj -> TreeSortable |
|
gTypeTreeSortable :: GType |
|
toTreeSortable :: TreeSortableClass o => o -> TreeSortable |
|
type SortColumnId = Int |
ID number of a sort column.
- A SortColumnId is a logical number to which a sorting function can
be associated. The number does not have to coincide with any column
number.
|
|
Constants
|
|
treeSortableDefaultSortColumnId :: SortColumnId |
A special SortColumnId to indicated that the default sorting function is used.
|
|
Methods
|
|
treeSortableGetSortColumnId |
|
|
treeSortableSetSortColumnId |
|
|
treeSortableSetSortFunc |
:: TreeSortableClass self | | => self | | -> SortColumnId | sortColumnId - the sort column id to set
the function for
| -> TreeIter -> TreeIter -> IO Ordering | sortFunc - The comparison function
| -> IO () | | Sets the comparison function used when sorting to be sortFunc. If the
current sort column id of self is the same as sortColumnId, then the
model will sort using this function.
|
|
|
treeSortableSetDefaultSortFunc |
|
|
treeSortableHasDefaultSortFunc |
:: TreeSortableClass self | | => self | | -> IO Bool | returns True, if the model has a default sort function
| Returns True if the model has a default sort function. This is used
primarily by Graphics.UI.Gtk.ModelView.TreeViewColumns in order to
determine if a model has a default ordering or if the entries are
retrieved in the sequence in which they are stored in the model.
|
|
|
treeSortableSortColumnChanged :: TreeSortableClass self => self -> IO () |
Emits a sortColumnChanged signal on the model.
|
|
Signals
|
|
sortColumnChanged :: TreeSortableClass self => Signal self (IO ()) |
|
Produced by Haddock version 2.4.2 |