traitsui.qt4.tree_node_renderers module

class traitsui.qt4.tree_node_renderers.WordWrapRenderer

Bases: traitsui.tree_node_renderer.AbstractTreeNodeRenderer

A renderer that wraps the label text across multiple lines.

max_lines = Int(5)

The maximum number of lines to show without eliding.

padding = HasBorder(0)

The padding around the text.

paint(editor, node, column, object, paint_context)

Paint word-wrapped text with elision.

size(editor, node, column, object, size_context)

Return the preferred size for the word-wrapped text

  • node (ITreeNode instance) – The tree node to render.
  • column (int) – The column in the tree that should be rendererd.
  • object (object) – The underlying object being edited.
  • size_context (object) – A toolkit-dependent context for performing sizing operations.


Return type:

tuple of (width, height) or None

width_hint = Int(100)

The a good size for the width of the item.

This Page