View¶
View can hold children of type Element. In some case, there is a
restriction on number of children it can hold.
-
class
Aduct.Views.View.View(**kwargs)¶ This an abstract class, that gives an idea of methods a
Viewmust have. Unless otherwise stated, all the description of methods are generalised expected behavior ofView. Depending upon the nature of view, the type of child it can hold also varies.-
add_child(child)¶ Adds the child
self.Parameters: Raises: ValueError– Raised when there is insufficient information to addchildtoself.TypeError– Raised whenchildis of invalid type.
Note
When there is a lack of information to add
child,selfmay try its best to addchildin suitable position.
-
get_props()¶ Gets the interface properties.
Returns: A dictionary with interface properties. Return type: dict
-
get_type()¶ Gets the interface properties.
Returns: A dictionary with interface properties. Return type: dict
-
remove_child(child)¶ Removes the given child.
Parameters: child ( VieworElement) – The child which has to be removed fromself.Raises: ValueError– Raises whenchildis not present inself.
-
replace_child(old_child, new_child)¶ Replaces the existing child with new child.
Parameters:
-