]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtktreesortable.sgml
Document GtkTreeIterCompareFunc (#154943)
[~andy/gtk] / docs / reference / gtk / tmpl / gtktreesortable.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkTreeSortable
3
4 <!-- ##### SECTION Short_Description ##### -->
5 The interface for sortable models used by GtkTreeView
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9
10 </para>
11
12 <!-- ##### SECTION See_Also ##### -->
13 <para>
14
15 </para>
16
17 <!-- ##### STRUCT GtkTreeSortable ##### -->
18 <para>
19
20 </para>
21
22
23 <!-- ##### SIGNAL GtkTreeSortable::sort-column-changed ##### -->
24 <para>
25
26 </para>
27
28 @treesortable: the object which received the signal.
29
30 <!-- ##### STRUCT GtkTreeSortableIface ##### -->
31 <para>
32
33 </para>
34
35 @g_iface: 
36 @sort_column_changed: 
37 @get_sort_column_id: 
38 @set_sort_column_id: 
39 @set_sort_func: 
40 @set_default_sort_func: 
41 @has_default_sort_func: 
42
43 <!-- ##### USER_FUNCTION GtkTreeIterCompareFunc ##### -->
44 <para>
45 A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive
46 integer if @a sorts before @b, @a sorts with @b, or @a sorts after @b
47 respectively. If two iters compare as equal, their order in the sorted model 
48 is undefined. In order to ensure that the #GtkTreeSortable behaves as 
49 expected, the GtkTreeIterCompareFunc must define a partial order on 
50 the model, i.e. it must be reflexive, antisymmetric and transitive.
51 </para>
52 <para>
53 For example, if @model is a product catalogue, then a compare function
54 for the "price" column could be one which returns 
55 <literal>price_of(@a) - price_of(@b)</literal>.
56 </para>
57
58 @model: The #GtkTreeModel the comparison is within
59 @a: A #GtkTreeIter in @model
60 @b: Another #GtkTreeIter in @model
61 @user_data: Data passed when the compare func is assigned e.g. by
62 gtk_tree_sortable_set_sort_func()
63
64 <!-- ##### FUNCTION gtk_tree_sortable_sort_column_changed ##### -->
65 <para>
66
67 </para>
68
69 @sortable: 
70
71
72 <!-- ##### FUNCTION gtk_tree_sortable_get_sort_column_id ##### -->
73 <para>
74
75 </para>
76
77 @sortable: 
78 @sort_column_id: 
79 @order: 
80 @Returns: 
81
82
83 <!-- ##### FUNCTION gtk_tree_sortable_set_sort_column_id ##### -->
84 <para>
85
86 </para>
87
88 @sortable: 
89 @sort_column_id: 
90 @order: 
91
92
93 <!-- ##### FUNCTION gtk_tree_sortable_set_sort_func ##### -->
94 <para>
95
96 </para>
97
98 @sortable: 
99 @sort_column_id: 
100 @sort_func: 
101 @user_data: 
102 @destroy: 
103
104
105 <!-- ##### FUNCTION gtk_tree_sortable_set_default_sort_func ##### -->
106 <para>
107
108 </para>
109
110 @sortable: 
111 @sort_func: 
112 @user_data: 
113 @destroy: 
114
115
116 <!-- ##### FUNCTION gtk_tree_sortable_has_default_sort_func ##### -->
117 <para>
118
119 </para>
120
121 @sortable: 
122 @Returns: 
123
124