Replies: 1 comment 1 reply
-
What you're describing is #2293. The feature has been requested many times; as is noted on that ticket, the devil is in the detail. You've discovered the easy part - that hierarchical markup languages map well to Toga's widget layout. You've used YAML; but JSON, XML, or any other markup language could be used here. What you haven't explored is the hard part - questions like:
As has been noted on #2293 - I definitely encourage you to dig into this further if you're motivated by markup languages as a use case. As you've already discovered, this may be able to develop as a third party library; but if you've got ideas about how this could integrate with the core app lifecycle, we're happy to entertain that discussions. The one request I'd make is that you avoid the "toga" prefix for any package you publish to PyPI - we'd like to reserve that name for official packages, and encourage community contributions to use the |
Beta Was this translation helpful? Give feedback.
-
I don't know if there's any interest - except from me - but I've created a library for loading Toga widget trees via strings. So instead of having to create all the widgets in code and appending them to each other I can just do it in the following manner:
This will return a Box widget (with id box1) and a Button (with id button1) as a child.
It also supports specifying event handlers:
As I've said I don't know if this is useful except me but I like the idea of declaring widgets in this way and if you do too, enjoy :). If my motivation won't die and there's interest I'm planning on implementing templating and other features.
Oh, I almost forgot.. The library can be found at https://github.com/tomplast/togawil
Beta Was this translation helpful? Give feedback.
All reactions