Container¶
- class tanmatsu.widgets.Container(*args, children: dict[str, tanmatsu.widgets.base.Widget], **kwargs)¶
Bases:
WidgetA widget that can have children widgets. Abstract base class.
- Parameters
children (dict[str, Widget]) – Dictionary containing child widgets. Keys are str (the names of the widgets) and values are Widget objects (the children).
- add_child(name: str, widget: Widget)¶
Add a child object widget named name. If a widget with that name already exists, then the widget corresponding to the name is updated instead.
- Parameters
name (str) – The name of the widget to add.
widget (Widget) – The widget object to add.
- del_child_by_name(name: str)¶
Delete the child widget with name name.
- Parameters
name (str) – The name of the widget to delete.
- Raises
KeyError – if the name does not exist in the children.