enaml.core.conditional

Classes

Conditional

A pattern object that represents conditional objects.

class enaml.core.conditional.Conditional(parent=None, **kwargs)[source]

Bases: Pattern

A pattern object that represents conditional objects.

When the condition attribute is True, the conditional will create its child items and insert them into its parent; when False, the old items will be destroyed.

condition

The condition variable. If this is True, a copy of the children will be inserted into the parent. Otherwise, the old copies will be destroyed.

items

The list of items created by the conditional. This list should not be manipulated directly by user code.

destroy()[source]

A reimplemented destructor.

The conditional will release the owned items on destruction.

pattern_items()[source]

Get a list of items created by the pattern.

refresh_items()[source]

Refresh the items of the pattern.

This method destroys the old items and creates and initializes the new items.