summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtktreesortable.sgml
blob: 546654b7efbb2d2825af7b2879149ef07d2b4c0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!-- ##### SECTION Title ##### -->
GtkTreeSortable

<!-- ##### SECTION Short_Description ##### -->
The interface for sortable models used by GtkTreeView

<!-- ##### SECTION Long_Description ##### -->
<para>
#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.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
#GtkTreeModel, #GtkTreeView
</para>

<!-- ##### STRUCT GtkTreeSortable ##### -->
<para>

</para>


<!-- ##### SIGNAL GtkTreeSortable::sort-column-changed ##### -->
<para>

</para>

@treesortable: the object which received the signal.

<!-- ##### 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>
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>.
</para>

@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()
@Returns: 


<!-- ##### 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: