Functions
flag_property | A factory function which creates a flag accessor property. |
Classes
Object | The most base class of the Enaml object hierarchy. |
A factory function which creates a flag accessor property.
Bases: atom.atom.Atom
The most base class of the Enaml object hierarchy.
An Enaml Object provides supports parent-children relationships and provides methods for navigating, searching, and destroying the tree.
An optional name to give to this object to assist in finding it in the tree (see . the ‘find’ method). There is no guarantee of uniqueness for an object name. It is left to the developer to choose an appropriate name.
The read-only property which returns the object parent. This will be an Object or None. Use ‘set_parent()’ or pass the parent to the constructor to set the parent of an object.
A read-only property which returns the object children. This is a list of Object instances. User code should not modify the list directly. Instead, use ‘set_parent()’ or ‘insert_children()’.
A property which gets and sets the destroyed flag. This should not be manipulated directly by user code.
An event fired when an object has been destroyed. It is triggered once during the object lifetime, just before the object is removed from the tree structure.
Initialize an Object.
Parameters : | parent : Object or None, optional
**kwargs :
|
---|
Destroy this object and all of its children recursively.
This will emit the destroyed event before any change to the object tree is made. After this returns, the object should be considered invalid and should no longer be used.
Set the parent for this object.
If the parent is not None, the child will be appended to the end of the parent’s children. If the parent is already the parent of this object, then this method is a no-op. If this object already has a parent, then it will be properly reparented.
Parameters : | parent : Object or None
|
---|
Notes
It is the responsibility of the caller to initialize and activate the object as needed, if it is reparented dynamically at runtime.
Insert children into this object at the given location.
The children will be automatically parented and inserted into the object’s children. If any children are already children of this object, then they will be moved appropriately.
Parameters : | before : Object, int or None
insert : iterable
|
---|
Notes
It is the responsibility of the caller to initialize and activate the object as needed, if it is reparented dynamically at runtime.
A method invoked when the parent of the object changes.
This method is called when the parent on the object has changed, but before the children of the new parent have been updated. Sublasses may reimplement this method as required.
Parameters : | old : Object or None
new : Object or None
|
---|
A method invoked when a child is added to the object.
Sublasses may reimplement this method as required.
Parameters : | child : Object
|
---|
A method invoked when a child is removed from the object.
Sublasses may reimplement this method as required.
Parameters : | child : Object
|
---|
Get the root object for this hierarchy.
Returns : | result : Object
|
---|
Yield all of the objects in the tree, from this object down.
Parameters : | depth_first : bool, optional
|
---|
Yield all of the objects in the tree, from this object up.
Parameters : | root : Object, optional
|
---|
Find the first object in the subtree with the given name.
This method will traverse the tree of objects, breadth first, from this object downward, looking for an object with the given name. The first object with the given name is returned, or None if no object is found with the given name.
Parameters : | name : string
regex : bool, optional
|
---|---|
Returns : | result : Object or None
|
Find all objects in the subtree with the given name.
This method will traverse the tree of objects, breadth first, from this object downward, looking for a objects with the given name. All of the objects with the given name are returned as a list.
Parameters : | name : string
regex : bool, optional
|
---|---|
Returns : | result : list of Object
|