custom dialogs
#4348
Replies: 1 comment
|
Thanks for sharing that. Agreed that a non-modal something is preferable to nothing. It might be worth writing this up as a HOWTO guide. What you've described here is a relatively common use case; even if it's not being used for dialogs, it might not be obvious that you can write a Window subclass. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I wanted to share a pattern / base class for creating custom dialogs in Toga that behave like the built-in dialogs (e.g., InfoDialog). By subclassing toga.Window and implementing the internal _show protocol, we can use the await app/window.dialog(...) syntax for any custom widget.
The dialogs do not behave modal, but when building a real application a non-modal dialog is still beter than no dialog. It made my code more consistent and it will probably be easier to upgrade when/if Toga supports custom dialogs.
Thoughts and improvements are definitely welcome!
All reactions