GtkCustomSorter

GtkCustomSorter — Sorting with a callbacks

Types and Values

Object Hierarchy

    GObject
    ╰── GtkSorter
        ╰── GtkCustomSorter

Includes

#include <gtk/gtk.h>

Description

GtkCustomSorter is a GtkSorter implementation that sorts via a traditional GCompareDataFunc callback.

Functions

gtk_custom_sorter_new ()

GtkCustomSorter *
gtk_custom_sorter_new (GCompareDataFunc sort_func,
                       gpointer user_data,
                       GDestroyNotify user_destroy);

Creates a new GtkSorter that works by calling sort_func to compare items.

If sort_func is NULL, all items are considered equal.

Parameters

sort_func

the GCompareDataFunc to use for sorting.

[nullable]

user_data

user data to pass to sort_func .

[nullable]

user_destroy

destroy notify for user_data .

[nullable]

Returns

a new GtkCustomSorter

gtk_custom_sorter_set_sort_func ()

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

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

self

a GtkCustomSorter

sort_func

function to sort items.

[nullable]

user_data

user data to pass to match_func .

[nullable]

user_destroy

destroy notify for user_data

Types and Values

GtkCustomSorter

typedef struct _GtkCustomSorter GtkCustomSorter;

© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkCustomSorter.html