.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.dataview.DataViewVirtualListModel:

==========================================================================================================================================
|phoenix_title|  **wx.dataview.DataViewVirtualListModel**
==========================================================================================================================================

:ref:`wx.dataview.DataViewVirtualListModel`  is a specialized data model which lets you address an item by its position (row) rather than its :ref:`wx.dataview.DataViewItem`  and as such offers the exact same interface as :ref:`wx.dataview.DataViewIndexListModel`.          

The important difference is that under platforms other than OS X, 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 OS X). 









.. seealso:: :ref:`wx.dataview.DataViewListModel`  for the API.  







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>DataViewVirtualListModel</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.dataview.DataViewVirtualListModel_inheritance.png" alt="Inheritance diagram of DataViewVirtualListModel" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.dataview.DataViewVirtualListModel.html" title="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." alt="" coords="5,237,287,267"/> <area shape="rect" id="node2" href="wx.dataview.DataViewListModel.html" title="Base class with abstract API for wx.dataview.DataViewIndexListModel  and wx.dataview.DataViewVirtualListModel." alt="" coords="27,160,265,189"/> <area shape="rect" id="node3" href="wx.dataview.DataViewModel.html" title="wx.dataview.DataViewModel  is the base class for all data model to be displayed by a wx.dataview.DataViewCtrl." alt="" coords="39,83,253,112"/> <area shape="rect" id="node4" href="wx.RefCounter.html" title="This class is used to manage reference-counting providing a simple interface and a counter." alt="" coords="86,5,206,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.dataview.DataViewVirtualListModel.__init__`                           Constructor.
:meth:`~wx.dataview.DataViewVirtualListModel.GetItem`                            Returns the :ref:`wx.dataview.DataViewItem`  at the given `row`.
:meth:`~wx.dataview.DataViewVirtualListModel.Reset`                              Call this after if the data has to be read again from the model.
:meth:`~wx.dataview.DataViewVirtualListModel.RowAppended`                        Call this after a row has been appended to the model.
:meth:`~wx.dataview.DataViewVirtualListModel.RowChanged`                         Call this after a row has been changed.
:meth:`~wx.dataview.DataViewVirtualListModel.RowDeleted`                         Call this after a row has been deleted.
:meth:`~wx.dataview.DataViewVirtualListModel.RowInserted`                        Call this after a row has been inserted at the given position.
:meth:`~wx.dataview.DataViewVirtualListModel.RowPrepended`                       Call this after a row has been prepended to the model.
:meth:`~wx.dataview.DataViewVirtualListModel.RowValueChanged`                    Call this after a value has been changed.
:meth:`~wx.dataview.DataViewVirtualListModel.RowsDeleted`                        Call this after rows have been deleted.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.dataview.DataViewVirtualListModel(DataViewListModel)

   **Possible constructors**::

       DataViewVirtualListModel(initial_size=0)
       
   
   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.



   .. method:: __init__(self, initial_size=0)

      Constructor.                  


      :param `initial_size`: 
      :type `initial_size`: int







   .. method:: GetItem(self, row)

      Returns the :ref:`wx.dataview.DataViewItem`  at the given `row`.                  


      :param `row`: 
      :type `row`: int




      :rtype: :ref:`wx.dataview.DataViewItem`








   .. method:: 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.                  


      :param `new_size`: 
      :type `new_size`: int







   .. method:: RowAppended(self)

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





   .. method:: RowChanged(self, row)

      Call this after a row has been changed.                  


      :param `row`: 
      :type `row`: int







   .. method:: RowDeleted(self, row)

      Call this after a row has been deleted.                  


      :param `row`: 
      :type `row`: int







   .. method:: RowInserted(self, before)

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


      :param `before`: 
      :type `before`: int







   .. method:: RowPrepended(self)

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





   .. method:: RowValueChanged(self, row, col)

      Call this after a value has been changed.                  


      :param `row`: 
      :type `row`: int
      :param `col`: 
      :type `col`: int







   .. method:: 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.                  


      :param `rows`: 
      :type `rows`: list of integers