phoenix_title wx.dataview.DataViewTextRenderer

wx.dataview.DataViewTextRenderer is used for rendering text.

It supports in-place editing if desired.


class_hierarchy Class Hierarchy

Inheritance diagram for class DataViewTextRenderer:

method_summary Methods Summary

__init__

The constructor.

EnableMarkup

Enable interpretation of markup in the item data.

GetDefaultType

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


Methods

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

The constructor.

Parameters:


EnableMarkup(self, enable=True)

Enable interpretation of markup in the item data.

If this method is called with True argument, markup ( 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 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 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
Parameters:

enable (bool) –

New in version 4.1/wxWidgets-3.1.1.

Note

Currently wx.dataview.DataViewIconTextRenderer only provides EnableMarkup EnableMarkup in wxGTK, but not under the other platforms, so you should only use it for plain wx.dataview.DataViewTextRenderer columns, without icons, in portable code.



static GetDefaultType()

Returns the Variant type used with this renderer.

Return type:

string

New in version 4.1/wxWidgets-3.1.0.