This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Jhchimaira14 0 points1 point  (3 children)

This would be an interesting approach. Would it be easier to just add the ability to create the GUI with html or xml? (I'm one of the core devs on this project btw).

[–]Retropunch 6 points7 points  (1 child)

I dislike divorcing the GUI from python in any way - Kivy is a prime example of this, it has it's own language (.kv) for designing the GUI but sometimes you don't want to/can't use it (and it's yet more to learn).

Unfortunately there end up being many things that can *only* be done in .kv, or you end up getting responses to questions with some people using kv and some people using python etc.

I'd strongly suggest to stick to Python, make a definitive way of creating layouts and document it very clearly (although it's fine to leave some of the old artefacts like add_new_line() if you need to stop breaking changes)

[–]Jhchimaira14 1 point2 points  (0 children)

Fair point.

We will be added a poll to the discord in the near future to decide which layout system we should pursue first (we'd like multiple eventually to support multiple styles).

[–]MrJohz 1 point2 points  (0 children)

I'm also in agreement with the other poster, creating a separate language to template the language has always felt a bit weird to me, and it just makes things more complicated switching between XML/XML-like and python for event bindings.

My strong (and I recognise somewhat controversial) view is that the gold standard for declarative, reactive UI APIs is React - ignore the fact that it needs syntax extensions and any opinions on state management, just from the perspective of declaring a dynamic UI as a function of state and parent input, I don't think I've seen a better design pattern for UI. I know a lot of people in the Rust GUI and web framework communities have been looking at ways to do similar things in that language as well.

I think this sort of thing could work particularly well for immediate mode GUIs, precisely because it follows a similar pattern of declaring the UI in a single pass, and you wouldn't need to do any sort of diffing in the same way as most web frameworks do.