Description Methods and Functions Hierarchy Implementations Detailed Description Structures User Functions Signals Author(s) References See Also
The interface for sortable models used by GtkTreeView
gtkTreeSortableSortColumnChanged(object)
gtkTreeSortableGetSortColumnId(object)
gtkTreeSortableSetSortColumnId(object, sort.column.id, order)
gtkTreeSortableSetSortFunc(object, sort.column.id, sort.func, user.data = NULL)
gtkTreeSortableSetDefaultSortFunc(object, sort.func, user.data = NULL)
gtkTreeSortableHasDefaultSortFunc(object)
1 2 | GInterface
+----GtkTreeSortable
|
GtkTreeSortable is implemented by
GtkListStore
, GtkTreeModelSort
and GtkTreeStore
.
GtkTreeSortable
is an interface to be implemented by tree models which
support sorting. The GtkTreeView
uses the methods provided by this interface
to sort the model.
GtkTreeSortable
undocumented
GtkTreeIterCompareFunc(model, a, b, user.data)
A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive
integer if a
sorts before b
, a
sorts with b
, or a
sorts after b
respectively. If two iters compare as equal, their order in the sorted model
is undefined. In order to ensure that the GtkTreeSortable
behaves as
expected, the GtkTreeIterCompareFunc must define a partial order on
the model, i.e. it must be reflexive, antisymmetric and transitive.
For example, if model
is a product catalogue, then a compare function
for the "price" column could be one which returns
price_of( a ) - price_of( b )
.
model
The GtkTreeModel
the comparison is within
a
A GtkTreeIter
in model
b
Another GtkTreeIter
in model
user.data
Data passed when the compare func is assigned e.g. by
gtkTreeSortableSetSortFunc
Returns: [integer] a negative integer, zero or a positive integer depending on whether
a
sorts before, with or after b
sort-column-changed(sortable, user.data)
The ::sort-column-changed signal is emitted when the sort column
or sort order of sortable
is changed. The signal is emitted before
the contents of sortable
are resorted.
sortable
the object on which the signal is emitted
user.data
user data set when the signal handler was connected.
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gtk2/stable/GtkTreeSortable.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.