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