2001-10-22 18:24:29 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
2003-07-02 22:45:30 +00:00
|
|
|
GtkTreeSortable
|
2001-10-22 18:24:29 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2003-06-23 22:59:01 +00:00
|
|
|
The interface for sortable models used by GtkTreeView
|
2001-10-22 18:24:29 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2004-12-15 17:25:10 +00:00
|
|
|
#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.
|
2001-10-22 18:24:29 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
2004-12-15 17:25:10 +00:00
|
|
|
#GtkTreeModel, #GtkTreeView
|
2001-10-22 18:24:29 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GtkTreeSortable ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
<!-- ##### SIGNAL GtkTreeSortable::sort-column-changed ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@treesortable: the object which received the signal.
|
|
|
|
|
2001-10-22 18:24:29 +00:00
|
|
|
<!-- ##### STRUCT GtkTreeSortableIface ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@g_iface:
|
|
|
|
@sort_column_changed:
|
|
|
|
@get_sort_column_id:
|
|
|
|
@set_sort_column_id:
|
|
|
|
@set_sort_func:
|
|
|
|
@set_default_sort_func:
|
|
|
|
@has_default_sort_func:
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GtkTreeIterCompareFunc ##### -->
|
|
|
|
<para>
|
2004-10-11 05:38:47 +00:00
|
|
|
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.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
For example, if @model is a product catalogue, then a compare function
|
|
|
|
for the "price" column could be one which returns
|
|
|
|
<literal>price_of(@a) - price_of(@b)</literal>.
|
2001-10-22 18:24:29 +00:00
|
|
|
</para>
|
|
|
|
|
2004-10-11 05:38:47 +00:00
|
|
|
@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
|
|
|
|
gtk_tree_sortable_set_sort_func()
|
2004-10-12 15:11:19 +00:00
|
|
|
@Returns:
|
|
|
|
|
2001-10-22 18:24:29 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_tree_sortable_sort_column_changed ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@sortable:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_tree_sortable_get_sort_column_id ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@sortable:
|
|
|
|
@sort_column_id:
|
|
|
|
@order:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_tree_sortable_set_sort_column_id ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@sortable:
|
|
|
|
@sort_column_id:
|
|
|
|
@order:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_tree_sortable_set_sort_func ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@sortable:
|
|
|
|
@sort_column_id:
|
|
|
|
@sort_func:
|
|
|
|
@user_data:
|
|
|
|
@destroy:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_tree_sortable_set_default_sort_func ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@sortable:
|
|
|
|
@sort_func:
|
|
|
|
@user_data:
|
|
|
|
@destroy:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_tree_sortable_has_default_sort_func ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@sortable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|