summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-07-16 19:52:08 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-07-16 20:21:21 -0400
commit5f33f4ae8ed5582afb5aead418c9a51705f4a023 (patch)
treeb4dd857e3297a62e520db0df5317f1cfd00db519
parentadf0e8b1e6c33cd1b71de4d74ff75581f20ce2e6 (diff)
downloadgtk+-5f33f4ae8ed5582afb5aead418c9a51705f4a023.tar.gz
docs: Add an example
Add a small example for setting up columnview sorting.
-rw-r--r--gtk/gtkcolumnview.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c
index acaa2b9b07..715b394fc7 100644
--- a/gtk/gtkcolumnview.c
+++ b/gtk/gtkcolumnview.c
@@ -1486,17 +1486,26 @@ gtk_column_view_get_list_view (GtkColumnView *self)
* gtk_column_view_get_sorter:
* @self: a #GtkColumnView
*
- * Returns the sorter associated with users sorting choices in
- * the column view.
+ * Returns a special sorter that reflects the users sorting
+ * choices in the column view.
*
* To allow users to customizable sorting by clicking on column
- * headers, this sorter needs to be set on the sort
- * model(s) underneath the model that is displayed
- * by the view.
+ * headers, this sorter needs to be set on the sort model underneath
+ * the model that is displayed by the view.
*
- * See gtk_column_view_column_get_sorter() for setting up
+ * See gtk_column_view_column_set_sorter() for setting up
* per-column sorting.
*
+ * Here is an example:
+ * |[
+ * gtk_column_view_column_set_sorter (column, sorter);
+ * gtk_column_view_append_column (view, column);
+ * model = gtk_sort_list_model_new (store,
+ * gtk_column_view_get_sorter (view));
+ * selection = gtk_no_selection_new (model);
+ * gtk_column_view_set_model (view, selection);
+ * ]|
+ *
* Returns: (transfer none): the #GtkSorter of @self
*/
GtkSorter *