Live data from Hacker News

Guietta – Python module to create simple GUIs

github.com

81–90 of 166 posts

Re: Guietta – Python module to create simple GUIs

#81
post #4

Every time I see something like this I think back to the glorious days of Borland Delphi with it's beautiful drag&drop GUI builder.

I remember equivalent tools for Python, e.g. Boa Constructor: http://boa-constructor.sourceforge.net/

It kind of popped up out of nowhere, fully-formed, or at least I became aware of it when it was pretty mature. It's basically Visual Basic for Python, and worked really well. I have no idea why it wasn't more popular.

Re: Guietta – Python module to create simple GUIs

#83

Earlier quoted context omitted.

Some of Python linters enforce such style. If you enable pylint or black I think they do that by default.

black sorts alphabetically, with standard lib first, then 3rd party imports, and user/local imports last. Blocks are separated by a blank line. `from ..` imports come after `import ..`. Especially the alphabetic ordering is important in my view. Makes parsing/reading and spotting duplicates much easier. It is also PEP8 style [0]. For all these reasons, I think the pyramid style is awful in comparison. 0: https://www.…

Black doesn't sort imports at all.

Re: Guietta – Python module to create simple GUIs

#88
post #86

Cool project, some questions. In the README, Quit is a button but doesn't appear to be consistent with the syntax of other buttons like ['Calculate']. Is there a reason for this? Also, how do you bind buttons to functions?

Quit is a built-in class, because is very common. There are also Yes, No, Ok and Cancel builtins. You could do the same writing ['Quit'] and binding it a function that quits the program.

Binding is done using QT's signals/slots mechanism under the hood, and can be done in several ways:

- using the 'with' statement as in the example, but this is often limited

- using an events layer, that is, a replica of the GUI layout, with a callable for each widget that you want to bind.

- using the @gui.auto decorator on a function: it will try to guess.

All this is described in the tutorial: https://guietta.readthedocs.io/en/latest/tutorial.html , chapter "GUI actions"

Re: Guietta – Python module to create simple GUIs

#89

Does it support reactive data binding? Like: https://github.com/Bomberus/LayoutX

No, you have to manually update widgets assigning them their new value (strings, and for labels also lists and dicts). I will think about such a feature but I have no experience with such dynamic frameworks :)

Re: Guietta – Python module to create simple GUIs

#90
post #57

Earlier quoted context omitted.

It takes many years and many people to build tools of that quality. Practically speaking it is way more easy to learn new language instead. I have no problem using Delphi and Lazarus for desktop applications. Saves me big amount of time.

The language isn't the problem, the ecosystem is :/

For Free Pascal (which is used in Lazarus), you can use almost all of the native libraries (linked dynamically, and in many cases even statically). It is not as straightforward and easy as using _pip_ or _npm_, and maybe not as organised, but you can translate the headers to Pascal and get it working. You are not stuck with what comes with Lazarus or Free Pascal, or libraries that are exclusively written in Free Pascal.
Post reply on HN