module Gtk::SectionModel

Overview

An interface that adds support for sections to list models.

A Gtk::SectionModel groups successive items into so-called sections. List widgets like Gtk::ListView and Gtk::GridView then allow displaying section headers for these sections by installing a header factory.

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

When the section groupings of a model change, the model will emit the [signal@Gtk.SectionModel::sections-changed] signal by calling the Gtk::SectionModel#sections_changed function. All sections in the given range then need to be queried again. The [signal@Gio.ListModel::items-changed] signal has the same effect, all sections in that range are invalidated, too.

Direct including types

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/section_model.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.cast(obj : GObject::Object) : self #

Cast a GObject::Object to self, throws a TypeCastError if the cast can't be made.


Class Method Detail

def self.cast?(obj : GObject::Object) : self | Nil #

def self.g_type : UInt64 #

Instance Method Detail

def section(position : UInt32, out_start : UInt32, out_end : UInt32) : Nil #

def sections_changed(position : UInt32, n_items : UInt32) : Nil #

def sections_changed_signal #

abstract def to_unsafe #