traitsui.ui_traits module

Defines common traits used within the traits.ui package.

class traitsui.ui_traits.ATheme(value=None, **metadata)[source]

Bases: TraitType

Defines a trait whose value must be a traits UI Theme or a string that can be converted to one.

default_value = None

Define the default value for the trait:

info_text = 'a Theme or string that can be used to define one'

A description of the type of value this trait accepts:

validate(object, name, value)[source]

Validates that a specified value is valid for this trait.

class traitsui.ui_traits.StatusItem(value=None, **traits)[source]

Bases: HasStrictTraits

name = Str("status")

The name of the trait the status information will be synched with:

width = Float(0.5)

The width of the status field. The possible values are:

  • abs( width ) > 1.0: Width of the field in pixels = abs( width )

  • abs( width ) <= 1.0: Relative width of the field when compared to

    the other relative width fields.

class traitsui.ui_traits.ViewStatus(default_value=<traits.trait_type._NoDefaultSpecifiedType object>, **metadata)[source]

Bases: TraitType

Defines a trait whose value must be a single StatusItem instance or a list of StatusItem instances.

default_value = None

Define the default value for the trait:

info_text = 'None, a string, a single StatusItem instance, or a list or tuple of strings and/or StatusItem instances'

A description of the type of value this trait accepts:

validate(object, name, value)[source]

Validates that a specified value is valid for this trait.

traitsui.ui_traits.convert_theme(value, level=3)[source]

Converts a specified value to a Theme if possible.