Hi Everybody,
WOW, this is an absolutely stunning project and I am more then impressed of the builder tool which could evolve to THE Python UI lib.
Of course this project is just starting up but you already have a documentation, which is something other projects are lacking for years.
Please understand this post as a summary of questions, findings and suggestions. You can take them into account or leave them alone.
I played around a little with the builder and I like the style of implementing functions and linking them to the suitable functions. Right from the start I tried to organize the logic for different views in different files in a subfolder of the app. From the main.py I imported simply the logic folder and in it's init.py all included modules are imported. It turns out that it is not easy identify the right function inside the builder because the builder only takes the function name but not the module name. So if you got two modules with functions named equally like handle_ok_button() then you can only guess which one is the right one. Maybe you should show the complete module name like logic.view1.handle_button_click to make it more clear. As a workaround I put the view name into the function name which isn't very pretty (like view1_handle_button_click).
I love the idea of linking the functions to events which could make creating UI's even as easy as it was with VB :-)
Unfortunately there are very few events right now. This leads to some problems. For example you can only handle the "ss-change" event for a textbox. This is not very handy because normally you need the value of the textbox as soon as the user has finished entering it. If I want to change for example a setpoint temperature to 21.5 degrees I will get 4 event calls for the 2, the 1, the Point and the 5. But I just need it once when the box looses the focus. So basically here I would prefer the onblur event.
Maybe it would be a good idea to implement all events the html specification has for a certain kind of control.
I use the pub/sub principle in many of my projects as well. Maybe it would be a good idea to give the user a function to fire custom events which can be used to run functions (e.g. fire_event("user_logon").
Furthermore it should be possible to style the elements with CSS in order to change the font, the color, the look of the border etc.
I think this should be possible to all controls and also to even change the CSS from the backend (hiding, changing color).
Also I was wondering if it is somehow possible to change the content the controls (innerhtml) from the backend without using a binding to the states dictionary. The state dictionary is a great idea but could be complicated to maintain for bigger projects. Having a second possibilty to change controls from python side would be great.
The html control could maybe be something you had in mind for this stuff, but I do not understand how to bind data or change the value of an abritrary html control. Maybe it is possible and I didn't find it in the docs or got it wrong.
My last two ideas are more or less feature requests.
I would love to make dialogues possible. Yes, you can switch to another view and use the view as a dialoge, but it would also be great to pop up a normal view as a dialogue which could be a small box. The dialogue could be separated from the underlying view with a half transparent separating layer. This would be great for Disclaimer boxes, teasers etc.
Last but not least your tool would be perfect for home automation or let's say visualization purposes. Here is often a use case for containers with absolute positioning of elements inside it. Normally you take a picture of a plant or a floor plan and then place controls which are holding the information on top of it. flet has a component like that and it's nice and easy to use but it would be absolutely amazing to design such things with a graphical drag and drop tool like the builder.
I am keen how yor project will evolve but the start is very very promising.
So please keep up the great work and grab the ideas you like from my post and throw the rest into the bin :-)
regards
Chris