A list model that presents a slice of another model.
This is useful when implementing paging by setting the size to the number of elements per page and updating the offset whenever a different page is opened.
GtkSliceListModel passes through sections from the underlying model.
function "+"
(Widget : access Gtk_Slice_List_Model_Record'Class)
return Glib.List_Model.Glist_Model
function "+"
(Widget : access Gtk_Slice_List_Model_Record'Class)
return Gtk.Section_Model.Gtk_Section_Model
function "-"
(Interf : Glib.List_Model.Glist_Model)
return Gtk_Slice_List_Model
function "-"
(Interf : Gtk.Section_Model.Gtk_Section_Model)
return Gtk_Slice_List_Model
function Get_Item
(Self : not null access Gtk_Slice_List_Model_Record;
Position : Guint) return Glib.Object.GObject
function Get_Item_Type
(Self : not null access Gtk_Slice_List_Model_Record) return GType
function Get_Model
(Self : not null access Gtk_Slice_List_Model_Record)
return Glib.List_Model.Glist_Model
Gets the model that is currently being used or null if none.
The model in use
function Get_N_Items
(Self : not null access Gtk_Slice_List_Model_Record) return Guint
function Get_Offset
(Self : not null access Gtk_Slice_List_Model_Record) return Guint
Gets the offset set via Gtk.Slice_List_Model.Set_Offset.
The offset
procedure Get_Section
(Self : not null access Gtk_Slice_List_Model_Record;
Position : Guint;
Out_Start : out Guint;
Out_End : out Guint)
function Get_Size
(Self : not null access Gtk_Slice_List_Model_Record) return Guint
Gets the size set via Gtk.Slice_List_Model.Set_Size.
The size
function Get_Type return Glib.GType
procedure Gtk_New
(Self : out Gtk_Slice_List_Model;
Model : Glib.List_Model.Glist_Model;
Offset : Guint;
Size : Guint)
Creates a new slice model. It presents the slice from Offset to offset + Size of the given Model. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The model to use
the offset of the slice
maximum size of the slice
type Gtk_Slice_List_Model is access all Gtk_Slice_List_Model_Record'Class;
function Gtk_Slice_List_Model_New
(Model : Glib.List_Model.Glist_Model;
Offset : Guint;
Size : Guint) return Gtk_Slice_List_Model
Creates a new slice model. It presents the slice from Offset to offset + Size of the given Model.
The model to use
the offset of the slice
maximum size of the slice
type Gtk_Slice_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_Slice_List_Model_Record, Gtk_Slice_List_Model);
package Implements_Gtk_Section_Model is new Glib.Types.Implements
(Gtk.Section_Model.Gtk_Section_Model, Gtk_Slice_List_Model_Record, Gtk_Slice_List_Model);
procedure Initialize
(Self : not null access Gtk_Slice_List_Model_Record'Class;
Model : Glib.List_Model.Glist_Model;
Offset : Guint;
Size : Guint)
Creates a new slice model. It presents the slice from Offset to offset + Size of the given Model. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The model to use
the offset of the slice
maximum size of the slice
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_Slice_List_Model_Record;
Position : Guint;
Removed : Guint;
Added : Guint)
Model_Property : constant Glib.Properties.Property_Boxed;
Type: Gio.List_Model Child model to take slice from.
N_Items_Property : constant Glib.Properties.Property_Uint;
The number of items. See [methodGio.ListModel.get_n_items].
Offset_Property : constant Glib.Properties.Property_Uint;
Offset of slice.
procedure Sections_Changed
(Self : not null access Gtk_Slice_List_Model_Record;
Position : Guint;
N_Items : Guint)
procedure Set_Model
(Self : not null access Gtk_Slice_List_Model_Record;
Model : Glib.List_Model.Glist_Model)
Sets the model to show a slice of. The model's item type must conform to Self's item type.
The model to be sliced
procedure Set_Offset
(Self : not null access Gtk_Slice_List_Model_Record;
Offset : Guint)
Sets the offset into the original model for this slice. If the offset is too large for the sliced model, Self will end up empty.
the new offset to use
procedure Set_Size
(Self : not null access Gtk_Slice_List_Model_Record;
Size : Guint)
Sets the maximum size. Self will never have more items than Size. It can however have fewer items if the offset is too large or the model sliced from doesn't have enough items.
the maximum size
Size_Property : constant Glib.Properties.Property_Uint;
Maximum size of slice.