Gtk.SliceListModel¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gio.ListModel (4), Gtk.SectionModel (2)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r/w/en |
|||
r |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.SliceListModel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkSliceListModel
is 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.- classmethod new(model, offset, size)[source]¶
- Parameters:
model (
Gio.ListModel
orNone
) – The model to useoffset (
int
) – the offset of the slicesize (
int
) – maximum size of the slice
- Returns:
A new
GtkSliceListModel
- Return type:
Creates a new slice model.
It presents the slice from offset to offset + size of the given model.
- get_model()[source]¶
- Returns:
The model in use
- Return type:
Gets the model that is currently being used or
None
if none.
- get_offset()[source]¶
- Returns:
The offset
- Return type:
Gets the offset set via
Gtk.SliceListModel.set_offset
().
- get_size()[source]¶
- Returns:
The size
- Return type:
Gets the size set via
Gtk.SliceListModel.set_size
().
- set_model(model)[source]¶
- Parameters:
model (
Gio.ListModel
orNone
) – The model to be sliced
Sets the model to show a slice of.
The model’s item type must conform to self's item type.
Property Details¶
- Gtk.SliceListModel.props.item_type¶
- Name:
item-type
- Type:
- Default Value:
<GType GObject>
- Flags:
The type of items. See [method`Gio`.ListModel.get_item_type].
New in version 4.8.
- Gtk.SliceListModel.props.model¶
- Name:
model
- Type:
- Default Value:
- Flags:
Child model to take slice from.
- Gtk.SliceListModel.props.n_items¶
-
The number of items. See [method`Gio`.ListModel.get_n_items].
New in version 4.8.
- Gtk.SliceListModel.props.offset¶
- Name:
offset
- Type:
- Default Value:
0
- Flags:
Offset of slice.
- Gtk.SliceListModel.props.size¶
- Name:
size
- Type:
- Default Value:
10
- Flags:
Maximum size of slice.