Interface

GtkSectionModel

unstable since: 4.12

Description [src]

interface Gtk.SectionModel : Gio.ListModel

GtkSectionModel is an interface that adds support for section to list models.

This support is then used by widgets using list models to be able to group their items into sections.

Many GTK list models support sections inherently, or they pass through the sections of a model they are wrapping.

A GtkSectionModel groups successive items into so-called sections. List widgets like GtkListView then allow displaying section headers for these sections.

When the section groupings of a model changes, the model will emit the GtkSectionModel::sections-changed signal by calling the gtk_section_model_sections_changed() function. All sections in the given range now need to be queried again. The GListModel::items-changed signal has the same effect, all sections in that range are invalidated, too.

Available since: 4.12

Prerequisite

In order to implement SectionModel, your type must inherit fromGListModel.

Instance methods

gtk_section_model_get_section

Query the section that covers the given position. The number of items in the section can be computed by out_end - out_start.

unstable since: 4.12

gtk_section_model_sections_changed
No description available.

Signals

Gtk.SectionModel::sections-changed

Emitted when the start-of-section state of some of the items in model changes.

unstable since: 4.12

Interface structure

struct GtkSectionModelInterface {
  void (* get_section) (
    GtkSectionModel* self,
    guint position,
    guint* out_start,
    guint* out_end
  );
  
}

The list of virtual functions for the GtkSectionModel interface. No function must be implemented, but unless GtkSectionModel::get_section() is implemented, the whole model will just be a single section.

Interface members
get_section
void (* get_section) (
    GtkSectionModel* self,
    guint position,
    guint* out_start,
    guint* out_end
  )
 No description available.

Virtual methods

Gtk.SectionModel.get_section

Query the section that covers the given position. The number of items in the section can be computed by out_end - out_start.

unstable since: 4.12