Add a clear()
method to remove all children
#1828
Labels
enhancement
New features, or improvements to existing features.
good first issue
Is this your first time contributing? This could be a good place to start!
What is the problem or limitation you are having?
At present, you can:
widget.add(child)
)widget.remove(child)
)widget.add(child1, child2)
)widget.remove(child1, child2)
)However, there is no API to remove all children from a node.
Describe the solution you'd like
widget.clear()
should remove all children from a widget. As of Travertino 0.2.0, aclear()
API exists; however, invoking it could have unexpected consequences, as it doesn't include the Toga-side cleanups implied by this change.Describe alternatives you've considered
widget.remove(*widget.children)
is a workaround at present, but isn't a great API.Additional context
No response
The text was updated successfully, but these errors were encountered: