Class: Gtk::CustomSorter

Inherits:
Sorter
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Methods inherited from Sorter

#changed, #compare, #order

Constructor Details

#initialize(sort_func, user_data, user_destroy) ⇒ Gtk::CustomSorter

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

If sort_func is nil, all items are considered equal.

Parameters:

  • sort_func (GLib::CompareDataFunc)

    the GCompareDataFunc to use for sorting

  • user_data (GObject)

    user data to pass to sort_func

  • user_destroy (GLib::DestroyNotify)

    destroy notify for user_data

Instance Method Details

#set_sort_func(sort_func, user_data, user_destroy) ⇒ nil

Sets (or unsets) the function used for sorting items.

If sort_func is nil, 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 (GLib::CompareDataFunc)

    function to sort items

  • user_data (GObject)

    user data to pass to match_func

  • user_destroy (GLib::DestroyNotify)

    destroy notify for user_data

Returns:

  • (nil)