wx.dataview.DataViewVirtualListModel¶
wx.dataview.DataViewVirtualListModel is a specialized data model which lets you address an item by its position (row) rather than its wx.dataview.DataViewItem and as such offers the exact same interface as wx.dataview.DataViewIndexListModel.
The important difference is that under platforms other than macOS, using this model will result in a truly virtual control able to handle millions of items as the control doesn’t store any item (a feature not supported by macOS).
See also
wx.dataview.DataViewListModel for the API.
Class Hierarchy¶
Methods Summary¶
Constructor. |
|
Returns the wx.dataview.DataViewItem at the given row. |
|
Call this after if the data has to be read again from the model. |
|
Call this after a row has been appended to the model. |
|
Call this after a row has been changed. |
|
Call this after a row has been deleted. |
|
Call this after a row has been inserted at the given position. |
|
Call this after a row has been prepended to the model. |
|
Call this after a value has been changed. |
|
Call this after rows have been deleted. |
Class API¶
- class wx.dataview.DataViewVirtualListModel(DataViewListModel)¶
Possible constructors:
DataViewVirtualListModel(initial_size=0) -> None
DataViewVirtualListModel is a specialized data model which lets you address an item by its position (row) rather than its DataViewItem and as such offers the exact same interface as DataViewIndexListModel.
Methods¶
- __init__(self, initial_size=0)¶
Constructor.
- Parameters:
initial_size (int)
- Return type:
None
- GetItem(self, row)¶
Returns the wx.dataview.DataViewItem at the given row.
- Parameters:
row (int)
- Return type:
- Reset(self, new_size)¶
Call this after if the data has to be read again from the model.
This is useful after major changes when calling the methods below (possibly thousands of times) doesn’t make sense.
- Parameters:
new_size (int)
- Return type:
None
- RowAppended(self)¶
Call this after a row has been appended to the model.
- Return type:
None
- RowChanged(self, row)¶
Call this after a row has been changed.
- Parameters:
row (int)
- Return type:
None
- RowDeleted(self, row)¶
Call this after a row has been deleted.
- Parameters:
row (int)
- Return type:
None
- RowInserted(self, before)¶
Call this after a row has been inserted at the given position.
- Parameters:
before (int)
- Return type:
None
- RowPrepended(self)¶
Call this after a row has been prepended to the model.
- Return type:
None
- RowValueChanged(self, row, col)¶
Call this after a value has been changed.
- Parameters:
row (int)
col (int)
- Return type:
None
- RowsDeleted(self, rows)¶
Call this after rows have been deleted.
The array will internally get copied and sorted in descending order so that the rows with the highest position will be deleted first.
- Parameters:
rows (list of integers)
- Return type:
None