docs: Revise sorter docs a bit

This commit is contained in:
Matthias Clasen 2020-07-16 21:45:11 -04:00
parent 5e97df5058
commit 72d66dfcdd
3 changed files with 12 additions and 9 deletions

View File

@ -65,9 +65,9 @@
<section>
<xi:include href="xml/gtksorter.xml" />
<xi:include href="xml/gtkcustomsorter.xml" />
<xi:include href="xml/gtkmultisorter.xml" />
<xi:include href="xml/gtkstringsorter.xml" />
<xi:include href="xml/gtknumericsorter.xml" />
<xi:include href="xml/gtkmultisorter.xml" />
</section>
<xi:include href="xml/gtkselectionmodel.xml" />
<section>

View File

@ -27,7 +27,7 @@
/**
* SECTION:gtkcustomsorter
* @Title: GtkCustomSorter
* @Short_description: Sorting with a callback
* @Short_description: Sorting with a callbacks
*
* GtkCustomSorter is a #GtkSorter implementation that sorts
* via a traditional #GCompareDataFunc callback.
@ -108,8 +108,10 @@ gtk_custom_sorter_init (GtkCustomSorter *self)
* Creates a new #GtkSorter that works by calling
* @sort_func to compare items.
*
* Returns: a new #GTkSorter
*/
* If @sort_func is %NULL, all items are considered equal.
*
* Returns: a new #GtkSorter
*/
GtkSorter *
gtk_custom_sorter_new (GCompareDataFunc sort_func,
gpointer user_data,
@ -129,10 +131,12 @@ gtk_custom_sorter_new (GCompareDataFunc sort_func,
* @self: a #GtkCustomSorter
* @sort_func: (nullable): function to sort items
* @user_data: (nullable): user data to pass to @match_func
* @user_destroy: destory notify
* @user_destroy: destroy notify for @user_data
*
* Sets (or unsets) the function used for sorting items.
*
*
* If @sort_func is %NULL, all items are considered equal.
*
* If the sort func changes its sorting behavior,
* gtk_sorter_changed() needs to be called.
*

View File

@ -37,9 +37,8 @@
* by calling gtk_sorter_compare() for pairs of items.
*
* Sorters may change their sorting behavior through their lifetime. In that case,
* they call gtk_sorter_changed(), which will emit the #GtkSorter::changed signal to
* notify that the sort order is no longer valid and should be updated by calling
* gtk_sorter_compare() again.
* they will emit the #GtkSorter::changed signal to notify that the sort order is
* no longer valid and should be updated by calling gtk_sorter_compare() again.
*
* GTK provides various pre-made sorter implementations for common sorting operations.
* #GtkColumnView has built-in support for sorting lists via the #GtkColumnViewColumn:sorter