A list model that can create child models on demand.
function "+"
(Widget : access Gtk_Tree_List_Model_Record'Class)
return Glib.List_Model.Glist_Model
function "-"
(Interf : Glib.List_Model.Glist_Model)
return Gtk_Tree_List_Model
Autoexpand_Property : constant Glib.Properties.Property_Boolean;
If all rows should be expanded by default.
function Get_Autoexpand
(Self : not null access Gtk_Tree_List_Model_Record) return Boolean
Gets whether the model is set to automatically expand new rows that get added. This can be either rows added by changes to the underlying models or via [methodGtk.TreeListRow.set_expanded].
True if the model is set to autoexpand
function Get_Child_Row
(Self : not null access Gtk_Tree_List_Model_Record;
Position : Guint) return Gtk.Tree_List_Row.Gtk_Tree_List_Row
Gets the row item corresponding to the child at index Position for Self's root model. If Position is greater than the number of children in the root model, null is returned. Do not confuse this function with [methodGtk.TreeListModel.get_row].
position of the child to get
the child in Position. Has transfer-ownership='full'.
function Get_Item
(Self : not null access Gtk_Tree_List_Model_Record;
Position : Guint) return Glib.Object.GObject
function Get_Item_Type
(Self : not null access Gtk_Tree_List_Model_Record) return GType
function Get_Model
(Self : not null access Gtk_Tree_List_Model_Record)
return Glib.List_Model.Glist_Model
Gets the root model that Self was created with.
the root model
function Get_N_Items
(Self : not null access Gtk_Tree_List_Model_Record) return Guint
function Get_Passthrough
(Self : not null access Gtk_Tree_List_Model_Record) return Boolean
Gets whether the model is passing through original row items. If this function returns False, the GListModel functions for Self return custom GtkTreeListRow objects. You need to call [methodGtk.TreeListRow.get_item] on these objects to get the original item. If True, the values of the child models are passed through in their original state. You then need to call [methodGtk.TreeListModel.get_row] to get the custom GtkTreeListRows.
True if the model is passing through original row items
function Get_Row
(Self : not null access Gtk_Tree_List_Model_Record;
Position : Guint) return Gtk.Tree_List_Row.Gtk_Tree_List_Row
Gets the row object for the given row. If Position is greater than the number of items in Self, null is returned. The row object can be used to expand and collapse rows as well as to inspect its position in the tree. See its documentation for details. This row object is persistent and will refer to the current item as long as the row is present in Self, independent of other rows being added or removed. If Self is set to not be passthrough, this function is equivalent to calling g_list_model_get_item. Do not confuse this function with [methodGtk.TreeListModel.get_child_row].
the position of the row to fetch
The row item. Has transfer-ownership='full'.
function Get_Type return Glib.GType
procedure Gtk_New
(Self : out Gtk_Tree_List_Model;
Root : Glib.List_Model.Glist_Model;
Passthrough : Boolean;
Autoexpand : Boolean;
Create_Func : Gtk_Tree_List_Model_Create_Model_Func)
Creates a new empty GtkTreeListModel displaying Root with all rows collapsed. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The GListModel to use as root
True to pass through items from the models
True to set the autoexpand property and expand the Root model
function to call to create the GListModel for the children of an item
type Gtk_Tree_List_Model is access all Gtk_Tree_List_Model_Record'Class;
type Gtk_Tree_List_Model_Create_Model_Func is access function
(Item : Glib.Object.GObject) return Glib.List_Model.Glist_Model;
Prototype of the function called to create new child models when gtk_tree_list_row_set_expanded() is called.
function Gtk_Tree_List_Model_New
(Root : Glib.List_Model.Glist_Model;
Passthrough : Boolean;
Autoexpand : Boolean;
Create_Func : Gtk_Tree_List_Model_Create_Model_Func)
return Gtk_Tree_List_Model
Creates a new empty GtkTreeListModel displaying Root with all rows collapsed.
The GListModel to use as root
True to pass through items from the models
True to set the autoexpand property and expand the Root model
function to call to create the GListModel for the children of an item
type Gtk_Tree_List_Model_Record is new GObject_Record with null record;
package Implements_Glist_Model is new Glib.Types.Implements
(Glib.List_Model.Glist_Model, Gtk_Tree_List_Model_Record, Gtk_Tree_List_Model);
procedure Initialize
(Self : not null access Gtk_Tree_List_Model_Record'Class;
Root : Glib.List_Model.Glist_Model;
Passthrough : Boolean;
Autoexpand : Boolean;
Create_Func : Gtk_Tree_List_Model_Create_Model_Func)
Creates a new empty GtkTreeListModel displaying Root with all rows collapsed. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The GListModel to use as root
True to pass through items from the models
True to set the autoexpand property and expand the Root model
function to call to create the GListModel for the children of an item
Item_Type_Property : constant Glib.Properties.Property_Boxed;
Type: GType The type of items. See [methodGio.ListModel.get_item_type].
procedure Items_Changed
(Self : not null access Gtk_Tree_List_Model_Record;
Position : Guint;
Removed : Guint;
Added : Guint)
Model_Property : constant Glib.Properties.Property_Boxed;
Type: Gio.List_Model The root model displayed.
N_Items_Property : constant Glib.Properties.Property_Uint;
The number of items. See [methodGio.ListModel.get_n_items].
Passthrough_Property : constant Glib.Properties.Property_Boolean;
Gets whether the model is in passthrough mode.
If False, the GListModel functions for this object return custom [classGtk.TreeListRow] objects. If True, the values of the child models are pass through unmodified.
procedure Set_Autoexpand
(Self : not null access Gtk_Tree_List_Model_Record;
Autoexpand : Boolean)
Sets whether the model should autoexpand. If set to True, the model will recursively expand all rows that get added to the model. This can be either rows added by changes to the underlying models or via [methodGtk.TreeListRow.set_expanded].
True to make the model autoexpand its rows