traitsui.view_element module

Defines the abstract ViewElement class that all trait view template items (i.e., View, Group, Item, Include) derive from.

class traitsui.view_element.DefaultViewElement[source]

Bases: ViewElement

A view element that can be used as a default value for traits whose value is a view element.

dock = DockStyle

The default dock style to use:

export = ExportType

The category of elements dragged out of the view:

image = Image

The default notebook tab image to use:

object = AnObject

The default context object to edit:

show_labels = Bool(True)

Should labels be added to items in a group?

style = EditorStyle

The default editor style to use:

class traitsui.view_element.ViewElement[source]

Bases: HasPrivateTraits

An element of a view.

is_includable()[source]

Returns whether the object is replacable by an Include object.

replace_include(view_elements)[source]

Searches the current object’s content attribute for objects that have an id attribute, and replaces each one with an Include object with the same id value, and puts the replaced object into the specified ViewElements object.

Parameters:

view_elements (ViewElements object) – Object containing Group, Item, and Include objects

class traitsui.view_element.ViewSubElement[source]

Bases: ViewElement

Abstract class representing elements that can be contained in a view.

container = Container

The object this ViewSubElement is contained in; must be a ViewElement.

help_id = HelpId

External help context identifier: