Class: Gtk::MapListModel
- Inherits:
-
Object
- Object
- Gtk::MapListModel
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#has_map ⇒ Boolean
Checks if a map function is currently set on self.
-
#has_map=(has_map) ⇒ Boolean
If a map is set for this model.
-
#has_map? ⇒ Boolean
If a map is set for this model.
-
#initialize(model, map_func, user_data, user_destroy) ⇒ Gtk::MapListModel
constructor
Creates a new
GtkMapListModelfor the given arguments. -
#item_type ⇒ GLib::Type
The type of items.
-
#item_type=(item_type) ⇒ GLib::Type
The type of items.
-
#model ⇒ Gio::ListModel
The model being mapped.
-
#model=(model) ⇒ Gio::ListModel
The model being mapped.
-
#n_items ⇒ Integer
The number of items.
-
#n_items=(n_items) ⇒ Integer
The number of items.
-
#set_map_func(map_func, user_data, user_destroy) ⇒ nil
Sets the function used to map items.
Constructor Details
#initialize(model, map_func, user_data, user_destroy) ⇒ Gtk::MapListModel
Creates a new GtkMapListModel for the given arguments.
Instance Method Details
#has_map ⇒ Boolean
Checks if a map function is currently set on self.
#has_map=(has_map) ⇒ Boolean
If a map is set for this model
#has_map? ⇒ Boolean
If a map is set for this model
#item_type ⇒ GLib::Type
The type of items. See [methodGio.ListModel.get_item_type].
#item_type=(item_type) ⇒ GLib::Type
The type of items. See [methodGio.ListModel.get_item_type].
#model ⇒ Gio::ListModel
The model being mapped.
#model=(model) ⇒ Gio::ListModel
The model being mapped.
#n_items ⇒ Integer
The number of items. See [methodGio.ListModel.get_n_items].
#n_items=(n_items) ⇒ Integer
The number of items. See [methodGio.ListModel.get_n_items].
#set_map_func(map_func, user_data, user_destroy) ⇒ nil
Sets the function used to map items.
The function will be called whenever an item needs to be mapped and must return the item to use for the given input item.
Note that GtkMapListModel may call this function multiple times
on the same item, because it may delete items it doesn't need anymore.
GTK makes no effort to ensure that map_func conforms to the item type of self. It assumes that the caller knows what they are doing and the map function returns items of the appropriate type.