4 ms·
I'm really, really excited about these GUI frameworks. Native desktop experience is so much better than web-view amalgamations. And kudos to PySimpleGUI for the
by BoppreH 3y ago
I'm really, really excited about these GUI frameworks. Native desktop experience is so much better than web-view amalgamations. And kudos to PySimpleGUI for the simplified event loop, and multi-backend approach, that is genuinely new.
I do wonder why don't we see more "automatic" GUIs: given some data structures and functions, make a passable interface to interact with them. Use heuristics to pick when a panel should be vertically or horizontally laid out, or placed in a tabbed interface, or a popup, etc. It would unlock a lot of functionality that is too nested for CLI and too "native" for web apps.
- scrlk 3y agoThis might be of interest to you: > Gooey - Turn (almost) any Python 3 Console Program into a GUI application with one line https://github.com/chriskiehl/Gooey https://github.com/chriskiehl/Gooey
- BoppreH 3y agoThanks, that's exactly the right direction. But not yet the right magnitude. You're still limited to what's representable as single CLI invocations.
- abecedarius 3y ago> "automatic" GUIs There was something answering that description a couple decades ago, called Naked Objects. Never tried it because I wasn't into Java, but it sounded useful.
- kspacewalk2 3y agoTraitsUI was/is a good "automatic UI" for python.
- destructionator 3y agoI've played with this a bit over the years, starting with my automatic form generator for the web back in 2011 based on function arguments (coupled with an automatic data to html thing to see the function output), and more recently some similar stuff for my gui toolkit too (using the D programming language). For example, you can write: ``` import arsd.minigui; void main() { // need to define the data you want in a struct, // it requires a struct even if you only want one item struct Data { string code; } // then do the dialog function with the struct and it // auto-creates a dialog for all the parts of the struct // and calls the function you provide when the user hits OK dialog((Data received) { // you got the number here messageBox("You gave me " ~ received.code); }); // need to run the event loop explicitly so main doesn't return // early and end your program; this will return when all windows are closed EventLoop.get.run(); } ``` You can also attach some user defined attributes to tell it which widget you want to control the thing (defaults are line input for string and int, drop-down select for enum, groups for structs... that's about all i bothered to implement so far, tbh my gui toolkit is more of a side project toy than a main event so the time i put in is limited), for example using `@ControlledBy!VerticalSlider(0, 100)` on an `int` to make it a slider from 0 to 100 instead of a text box asking for a number. My menu thing uses this too, you can attach functions to menus and it can pop up a dialog. For example you might do `@menu("Search") Find(string text) { ... }` and let it auto-generate the menu and dialog box for it. I also have a `DataControllerWidget` which does the callback on any change event, allowing for real-time manipulation. I wrote a little blog post about this a couple years ago (seriously, i move sooooo slowly on this stuff!) http://dpldocs.info/this-week-in-d/Blog.Posted_2020_11_02.html#what-adam-is-working-on http://dpldocs.info/this-week-in-d/Blog.Posted_2020_11_02.ht... I'd love to spend more time on this, I think it is really cool, but tbh I haven't gone too far beyond the basics and since day job has no use for such stuff it gotta be squeezed into when i feel like doing code on the weekend.