textual
textual copied to clipboard
unmount
We need a way to "unmount" a widget. There is a "mount" method on App, so I'm thinking there should be an equivalent "unmount" method.
We probably also want a shortcut on the widget itself.
Q. Should this be Widget.unmount? That feels wrong since there is not Widget.mount. But perhaps mounting is just a detail. Conceptually the user is removing the widget from the display, so maybe Widget.remove ?
I suspect that remove should send an event to the Widget, which then responds by unmounting itself. This would give the widget a chance perform clean up operations.
Note, this shutting down things is a deceptively difficult issues in asyncio. Discuss with @willmcgugan
https://github.com/Textualize/textual/pull/653