MapListModel
Object Hierarchy:
Description:
[ CCode ( type_id = "gtk_map_list_model_get_type ()" ) ]
public class MapListModel : Object, ListModel
A `GtkMapListModel` maps the items in a list model to different items.
`GtkMapListModel` uses a [[email protected]].
Example: Create a list of `GtkEventControllers` ```c 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.
Content:
Properties:
Creation methods:
Methods:
- public unowned ListModel? get_model ()
Gets the model that is currently being mapped or
null if none.
- public void set_map_func (owned MapListModelMapFunc? map_func)
Sets the function used to map items.
- public void set_model (ListModel? model)
Sets the model to be mapped.
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface GLib.ListModel