## GtkTreeListRowSorter GtkTreeListRowSorter — Sort trees by levels |

## Functions

GtkTreeListRowSorter * | gtk_tree_list_row_sorter_new ()
GtkSorter * | gtk_tree_list_row_sorter_get_sorter ()
void | gtk_tree_list_row_sorter_set_sorter ()

## Properties

GtkSorter * | sorter | Read / Write

## Types and Values

| GtkTreeListRowSorter

## Object Hierarchy

        GObject
        ╰── GtkSorter
            ╰── GtkTreeListRowSorter

## Includes

    #include <gtk/gtk.h>

## Description

GtkTreeListRowSorter is a special-purpose sorter that will apply a given sorter to the levels in a tree, while respecting the tree structure.

Here is an example for setting up a column view with a tree model and a GtkTreeListSorter:

    1
    2
    3
    4
    5
    column_sorter = gtk_column_view_get_sorter (view);
    sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter));
    sort_model = gtk_sort_list_model_new (tree_model, sorter);
    selection = gtk_single_selection_new (sort_model);
    gtk_column_view_set_model (view, G_LIST_MODEL (selection));

## Functions

### gtk_tree_list_row_sorter_new ()

    GtkTreeListRowSorter *
    gtk_tree_list_row_sorter_new (GtkSorter *sorter);

Create a special-purpose sorter that applies the sorting of `sorter` to the levels of a GtkTreeListModel.

Note that this sorter relies on “passthrough” being `FALSE` as it can only sort GtkTreeListRows.

#### Parameters

sorter | a GtkSorter, or `NULL`. | [nullable][transfer full]

#### Returns

a new GtkTreeListRowSorter

### gtk_tree_list_row_sorter_get_sorter ()

    GtkSorter *
    gtk_tree_list_row_sorter_get_sorter (GtkTreeListRowSorter *self);

Returns the sorter used by `self` .

#### Parameters

self | a GtkTreeListRowSorter |

#### Returns

the sorter used.

[transfer none][nullable]

### gtk_tree_list_row_sorter_set_sorter ()

    void
    gtk_tree_list_row_sorter_set_sorter (GtkTreeListRowSorter *self,
                                         GtkSorter *sorter);

Sets the sorter to use for items with the same parent.

This sorter will be passed the “item” of the tree list rows passed to `self` .

#### Parameters

self | a GtkTreeListRowSorter |
sorter | The sorter to use, or `NULL`. | [nullable][transfer none]

## Types and Values

### GtkTreeListRowSorter

    typedef struct _GtkTreeListRowSorter GtkTreeListRowSorter;

## Property Details

### The `“sorter”` property

      “sorter”                   GtkSorter *

The underlying sorter

Owner: GtkTreeListRowSorter

Flags: Read / Write

## See Also

GtkTreeListModel