### Method

# Gtk CustomSorter set_sort_func

#### Declaration [src]

    void
    gtk_custom_sorter_set_sort_func (
      GtkCustomSorter* self,
      GCompareDataFunc sort_func,
      gpointer user_data,
      GDestroyNotify user_destroy
    )

#### Description [src]

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.

If a previous function was set, its `user_destroy` will be called now.

#### Parameters

`sort_func`

  Type: `GCompareDataFunc`

  Function to sort items.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  User data to pass to `match_func`.

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

`user_destroy`

  Type: `GDestroyNotify`

  Destroy notify for `user_data`.