Include¶
No example available.
Declaration¶
- class enaml.core.include.Include(parent=None, **kwargs)[source]¶
Bases:
DeclarativeAn object which dynamically inserts children into its parent.
The ‘Include’ object is used to cleanly and easily insert objects into the children of its parent. ‘Object’ instances assigned to the ‘objects’ list of the ‘Include’ will be parented with the parent of the ‘Include’. Creating an ‘Include’ with no parent is a programming error.
- Attributes:
- children
- destroy_old
- destroyed
- initialized
- is_destroyed
- is_initialized
- name
- objects
- parent
Methods
child_added(child)An overridden child added event handler.
child_moved(child)A method invoked when a child is moved in the object.
child_removed(child)A method invoked when a child is removed from the object.
destroy()A reimplemented destructor.
find(name[, regex])Find the first object in the subtree with the given name.
find_all(name[, regex])Find all objects in the subtree with the given name.
freezeFreeze the atom to prevent further modifications to its attributes.
get_memberGet the named member for the atom.
has_observerGet whether the atom has the given observer for a given topic.
has_observersGet whether the atom has observers for a given topic.
A reimplemented initializer.
insert_children(before, insert)Insert children into this object at the given location.
members()Get the members dictionary for the type.
notifications_enabledGet whether notification is enabled for the atom.
notifyCall the registered observers for a given topic with positional and keyword arguments.
observeRegister an observer callback to observe changes on the given topic(s).
parent_changed(old, new)A method invoked when the parent of the object changes.
root_object()Get the root object for this hierarchy.
set_notifications_enabledEnable or disable notifications for the atom.
set_parent(parent)Set the parent for this object.
suppress_notifications()Disable member notifications within in a context.
traverse([depth_first])Yield all of the objects in the tree, from this object down.
traverse_ancestors([root])Yield all of the objects in the tree, from this object up.
unobserveUnregister an observer callback for the given topic(s).
- destroy()[source]¶
A reimplemented destructor.
The Include will destroy all of its objects if the ‘destroy_old’ flag is set and the parent is not also being destroyed.
- destroy_old¶
A boolean flag indicating whether to destroy the old objects that are removed from the parent. The default is True.
- initialize()[source]¶
A reimplemented initializer.
This method will add the include objects to the parent of the include and ensure that they are initialized.
- objects¶
The list of objects belonging to this Include. Objects in this list will be automatically parented with the Include’s parent.
No implementation found