Gtk.MultiSorter

g GObject.GInterface GObject.GInterface Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.Object GObject.Object Gtk.Sorter Gtk.Sorter GObject.Object->Gtk.Sorter Gtk.MultiSorter Gtk.MultiSorter Gio.ListModel->Gtk.MultiSorter Gtk.Buildable->Gtk.MultiSorter Gtk.Sorter->Gtk.MultiSorter

Subclasses:

None

Methods

Inherited:

Gtk.Sorter (3), GObject.Object (37), Gio.ListModel (4), Gtk.Buildable (1)

Structs:

GObject.ObjectClass (5)

class

new ()

append (sorter)

remove (position)

Virtual Methods

Inherited:

Gtk.Sorter (2), GObject.Object (7), Gio.ListModel (3), Gtk.Buildable (9)

Properties

Name

Type

Flags

Short Description

item-type

GObject.GType

r

n-items

int

r

Signals

Inherited:

Gtk.Sorter (1), GObject.Object (1), Gio.ListModel (1)

Fields

Inherited:

Gtk.Sorter (1), GObject.Object (1), Gio.ListModel (1)

Class Details

class Gtk.MultiSorter(**kwargs)
Bases:

Gtk.Sorter, Gio.ListModel, Gtk.Buildable

Abstract:

No

Structure:

Gtk.MultiSorterClass

GtkMultiSorter combines multiple sorters by trying them in turn.

If the first sorter compares two items as equal, the second is tried next, and so on.

classmethod new()[source]
Returns:

a new GtkMultiSorter

Return type:

Gtk.MultiSorter

Creates a new multi sorter.

This sorter compares items by trying each of the sorters in turn, until one returns non-zero. In particular, if no sorter has been added to it, it will always compare items as equal.

append(sorter)[source]
Parameters:

sorter (Gtk.Sorter) – a sorter to add

Add sorter to self to use for sorting at the end.

self will consult all existing sorters before it will sort with the given sorter.

remove(position)[source]
Parameters:

position (int) – position of sorter to remove

Removes the sorter at the given position from the list of sorter used by self.

If position is larger than the number of sorters, nothing happens.

Property Details

Gtk.MultiSorter.props.item_type
Name:

item-type

Type:

GObject.GType

Default Value:

<GType GtkSorter>

Flags:

READABLE

The type of items. See [method`Gio`.ListModel.get_item_type].

New in version 4.8.

Gtk.MultiSorter.props.n_items
Name:

n-items

Type:

int

Default Value:

0

Flags:

READABLE

The number of items. See [method`Gio`.ListModel.get_n_items].

New in version 4.8.