.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.dataview.DataViewChoiceRenderer:
==========================================================================================================================================
|phoenix_title| **wx.dataview.DataViewChoiceRenderer**
==========================================================================================================================================
A :ref:`wx.dataview.DataViewCtrl` renderer using :ref:`wx.Choice` control and values of strings in it.
This class is used by :ref:`wx.dataview.DataViewCtrl` to render choice controls. It stores a string so that :meth:`~wx.dataview.DataViewRenderer.SetValue` and :meth:`~wx.dataview.DataViewRenderer.GetValue` operate on a variant holding a string.
.. seealso:: `DataViewChoiceByIndexRenderer`
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
DataViewChoiceRenderer:
|
|sub_classes| Known Subclasses
==============================
`DataViewChoiceByIndexRenderer`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.dataview.DataViewChoiceRenderer.__init__` The constructor.
:meth:`~wx.dataview.DataViewChoiceRenderer.GetChoice` Returns the choice referred to by index.
:meth:`~wx.dataview.DataViewChoiceRenderer.GetChoices` Returns all choices.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.dataview.DataViewChoiceRenderer.Choices` See :meth:`~wx.dataview.DataViewChoiceRenderer.GetChoices`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.dataview.DataViewChoiceRenderer(DataViewRenderer)
**Possible constructors**::
DataViewChoiceRenderer(choices : List[str], mode:
DataViewCellMode=DATAVIEW_CELL_EDITABLE, alignment:
int=DVR_DEFAULT_ALIGNMENT) -> None
A DataViewCtrl renderer using Choice control and values of strings
in it.
.. method:: __init__(self, choices : List[str], mode: DataViewCellMode=DATAVIEW_CELL_EDITABLE, alignment: int=DVR_DEFAULT_ALIGNMENT)
The constructor.
:param `choices`:
:type `choices`: list of strings
:param `mode`:
:type `mode`: wx.dataview.DataViewCellMode
:param `alignment`:
:type `alignment`: int
:rtype: `None`
.. method:: GetChoice(self, index : int)
Returns the choice referred to by index.
:param `index`: A valid index, i.e. a value between 0 and number of choices minus one.
:type `index`: int
:rtype: `str`
.. method:: GetChoices(self)
Returns all choices.
:rtype: `List[str]`
.. attribute:: Choices
See :meth:`~wx.dataview.DataViewChoiceRenderer.GetChoices`