textual icon indicating copy to clipboard operation
textual copied to clipboard

unmount

Open willmcgugan opened this issue 3 years ago • 1 comments

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

willmcgugan avatar Jun 30 '22 08:06 willmcgugan

https://github.com/Textualize/textual/pull/653

willmcgugan avatar Aug 06 '22 12:08 willmcgugan

Did we solve your problem?

Consider buying the Textualize developers a coffee to say thanks.

Textualize

github-actions[bot] avatar Aug 09 '22 15:08 github-actions[bot]