wx.dataview.DataViewTextRenderer¶
wx.dataview.DataViewTextRenderer is used for rendering text.
It supports in-place editing if desired.
Class Hierarchy¶
Methods Summary¶
The constructor. |
|
Enable interpretation of markup in the item data. |
|
Returns the Variant type used with this renderer. |
Class API¶
- class wx.dataview.DataViewTextRenderer(DataViewRenderer)¶
Possible constructors:
DataViewTextRenderer(varianttype=DataViewTextRenderer.GetDefaultType(), mode=DATAVIEW_CELL_INERT, align=DVR_DEFAULT_ALIGNMENT) -> None
DataViewTextRenderer is used for rendering text.
Methods¶
- __init__(self, varianttype=DataViewTextRenderer.GetDefaultType(), mode=DATAVIEW_CELL_INERT, align=DVR_DEFAULT_ALIGNMENT)¶
The constructor.
- Parameters:
varianttype (string)
mode (DataViewCellMode)
align (int)
- Return type:
None
- 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)
- Return type:
None
Added 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:
str
Added in version 4.1/wxWidgets-3.1.0.