### Method

# Gtk ListBox set_sort_func

#### Declaration [src]

    void
    gtk_list_box_set_sort_func (
      GtkListBox* box,
      GtkListBoxSortFunc sort_func,
      gpointer user_data,
      GDestroyNotify destroy
    )

#### Description [src]

Sets a sort function.

By setting a sort function on the `box` one can dynamically reorder the rows of the list, based on the contents of the rows.

The `sort_func` will be called for each row after the call, and will continue to be called each time a row changes (via `gtk_list_box_row_changed()`) and when `gtk_list_box_invalidate_sort()` is called.

Note that using a sort function is incompatible with using a model (see `gtk_list_box_bind_model()`).

#### Parameters

`sort_func`

  Type: `GtkListBoxSortFunc`

  The sort function.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  User data passed to `sort_func`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`destroy`

  Type: `GDestroyNotify`

  Destroy notifier for `user_data`.