phoenix_title wx.dataview.DataViewIndexListModel

wx.dataview.DataViewIndexListModel is a specialized data model which lets you address an item by its position (row) rather than its wx.dataview.DataViewItem (which you can obtain from this class).

This model also provides its own wx.dataview.DataViewIndexListModel.Compare method which sorts the model’s data by the index.

This model is not a virtual model since the control stores each wx.dataview.DataViewItem. Use wx.dataview.DataViewVirtualListModel if you need to display millions of items or have other reason to use a virtual control.

See also

wx.dataview.DataViewListModel for the API.


class_hierarchy Class Hierarchy

Inheritance diagram for class DataViewIndexListModel:

sub_classes Known Subclasses

wx.dataview.DataViewListStore


method_summary Methods Summary

__init__

Constructor.

GetItem

Returns the wx.dataview.DataViewItem at the given row.

Reset

Call this after if the data has to be read again from the model.

RowAppended

Call this after a row has been appended to the model.

RowChanged

Call this after a row has been changed.

RowDeleted

Call this after a row has been deleted.

RowInserted

Call this after a row has been inserted at the given position.

RowPrepended

Call this after a row has been prepended to the model.

RowValueChanged

Call this after a value has been changed.

RowsDeleted

Call this after rows have been deleted.


api Class API

class wx.dataview.DataViewIndexListModel(DataViewListModel)

Possible constructors:

DataViewIndexListModel(initial_size: int=0) -> None

DataViewIndexListModel is a specialized data model which lets you address an item by its position (row) rather than its DataViewItem (which you can obtain from this class).


Methods

__init__(self, initial_size: int=0)

Constructor.

Parameters:

initial_size (int) –

Return type:

None



GetItem(self, row : int)

Returns the wx.dataview.DataViewItem at the given row.

Parameters:

row (int) –

Return type:

wx.dataview.DataViewItem



Reset(self, new_size : int)

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 : int)

Call this after a row has been changed.

Parameters:

row (int) –

Return type:

None



RowDeleted(self, row : int)

Call this after a row has been deleted.

Parameters:

row (int) –

Return type:

None



RowInserted(self, before : int)

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 : int, col : int)

Call this after a value has been changed.

Parameters:
  • row (int) –

  • col (int) –

Return type:

None



RowsDeleted(self, rows : List[int])

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