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

   <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>DataViewTextRenderer</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.DataViewTextRenderer_inheritance.png" alt="Inheritance diagram of DataViewTextRenderer" 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.DataViewTextRenderer.html" title="wx.dataview.DataViewTextRenderer" alt="" coords="5,160,261,189"/> <area shape="rect" id="node2" href="wx.dataview.DataViewRenderer.html" title="wx.dataview.DataViewRenderer" alt="" coords="19,83,248,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="90,5,177,35"/> </map> 
   </p>
   </div>

|


|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 :ref:`Variant`  type used with this renderer.
================================================================================ ================================================================================


|


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


.. class:: wx.dataview.DataViewTextRenderer(DataViewRenderer)

   **Possible constructors**::

       DataViewTextRenderer(varianttype=DataViewTextRenderer.GetDefaultType(),
                            mode=DATAVIEW_CELL_INERT, align=DVR_DEFAULT_ALIGNMENT)
       
   
   DataViewTextRenderer is used for rendering text.



   .. method:: __init__(self, varianttype=DataViewTextRenderer.GetDefaultType(), mode=DATAVIEW_CELL_INERT, align=DVR_DEFAULT_ALIGNMENT)

      The constructor.                  


      :param `varianttype`: 
      :type `varianttype`: string
      :param `mode`: 
      :type `mode`: wx.dataview.DataViewCellMode
      :param `align`: 
      :type `align`: int







   .. method:: EnableMarkup(self, enable=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 <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 = ("<span color=\"#87ceeb\">light</span> and "
                           "<span color=\"#000080\">dark</span> blue")
        
              return value



                


      :param `enable`: 
      :type `enable`: bool






      .. 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 :ref:`Variant`  type used with this renderer.                  

                

      :rtype: `string`







      .. versionadded:: 4.1/wxWidgets-3.1.0  
     







