MapListModel

open class MapListModel(pointer: <Error class: unknown class><<Error class: unknown class>>)

A GtkMapListModel maps the items in a list model to different items.

GtkMapListModel uses a callback@Gtk.MapListModelMapFunc.

Example: Create a list of GtkEventControllers

static gpointer
map_to_controllers (gpointer widget,
gpointer data)
{
gpointer result = gtk_widget_observe_controllers (widget);
g_object_unref (widget);
return result;
}

widgets = gtk_widget_observe_children (widget);

controllers = gtk_map_list_model_new (widgets,
map_to_controllers,
NULL, NULL);

model = gtk_flatten_list_model_new (GTK_TYPE_EVENT_CONTROLLER,
controllers);

GtkMapListModel will attempt to discard the mapped objects as soon as they are no longer needed and recreate them if necessary.

Skipped during bindings generation

  • method has-map: Property has no getter nor setter

Constructors

Link copied to clipboard
constructor(model: <Error class: unknown class>? = null, mapFunc: MapListModelMapFunc)

Creates a new GtkMapListModel for the given arguments.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val gioListModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkMapListModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val model: <Error class: unknown class>?

The model being mapped.

Functions

Link copied to clipboard
open fun getModel(): <Error class: unknown class>?

Gets the model that is currently being mapped or null if none.

Link copied to clipboard
open fun hasMap(): Boolean

Checks if a map function is currently set on @self.

Link copied to clipboard
open fun setMapFunc(mapFunc: MapListModelMapFunc)

Sets the function used to map items.

Link copied to clipboard
open fun setModel(model: <Error class: unknown class>? = null)

Sets the model to be mapped.