.. 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.DataViewTextRenderer:
==========================================================================================================================================
|phoenix_title| **wx.dataview.DataViewTextRenderer**
==========================================================================================================================================
:ref:`wx.dataview.DataViewTextRenderer` is used for rendering text.
It supports in-place editing if desired.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
DataViewTextRenderer:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.dataview.DataViewTextRenderer.__init__` The constructor.
:meth:`~wx.dataview.DataViewTextRenderer.EnableMarkup` Enable interpretation of markup in the item data.
:meth:`~wx.dataview.DataViewTextRenderer.GetDefaultType` Returns the `Variant` type used with this renderer.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.dataview.DataViewTextRenderer(DataViewRenderer)
**Possible constructors**::
DataViewTextRenderer(varianttype:
str=DataViewTextRenderer.GetDefaultType(), mode:
DataViewCellMode=DATAVIEW_CELL_INERT, align: int=DVR_DEFAULT_ALIGNMENT)
-> None
DataViewTextRenderer is used for rendering text.
.. method:: __init__(self, varianttype: str=DataViewTextRenderer.GetDefaultType(), mode: DataViewCellMode=DATAVIEW_CELL_INERT, align: int=DVR_DEFAULT_ALIGNMENT)
The constructor.
:param `varianttype`:
:type `varianttype`: string
:param `mode`:
:type `mode`: wx.dataview.DataViewCellMode
:param `align`:
:type `align`: int
:rtype: `None`
.. method:: EnableMarkup(self, enable: bool=True)
Enable interpretation of markup in the item data.
If this method is called with ``True`` argument, markup ( :meth:`wx.Control.SetLabelMarkup` ) in the data of the items in this column will be interpreted, which can be used for a more fine-grained appearance control than just setting an attribute, which affects all of the item text.
For example, as shown in the :ref:`DataViewCtrl Sample `, after creating a column using a markup-enabled renderer: ::
renderer = wx.DataViewTextRenderer()
renderer.EnableMarkup()
dataViewCtrl.AppendColumn(wx.DataViewColumn("title", renderer, 0))
The overridden model :meth:`wx.dataview.DataViewModel.GetValue` method may return values containing markup for this column: ::
def GetValue(self, item, col):
if col == 0 and item == ...:
value = ("light and "
"dark blue")
return value
:param `enable`:
:type `enable`: bool
:rtype: `None`
.. versionadded:: 4.1/wxWidgets-3.1.1
.. note::
Currently :ref:`wx.dataview.DataViewIconTextRenderer` only provides :meth:`EnableMarkup` :meth:`EnableMarkup` in wxGTK, but not under the other platforms, so you should only use it for plain :ref:`wx.dataview.DataViewTextRenderer` columns, without icons, in portable code.
.. staticmethod:: GetDefaultType()
Returns the `Variant` type used with this renderer.
:rtype: `str`
.. versionadded:: 4.1/wxWidgets-3.1.0