.Net Like Gui Builder for Python?

Chris Angelico rosuav at gmail.com
Fri Jul 25 22:40:09 EDT 2014


On Sat, Jul 26, 2014 at 7:23 AM, Dietmar Schwertberger
<maillist at schwertberger.de> wrote:
> Am 25.07.2014 16:55, schrieb Orochi:
>
>> So,Is there any Gui App builder like Visual Studio or having features like
>> Visual Studio for Python.
>
> Unfortunately there's nothing like that.
> IMHO the lack of such a tool is a major blocking point in many (corporate)
> environments...
>
> From the GUI builders that I have tried, wxFormBuilder comes next.

The OP asked for two things, which I'll separate because they're
actually quite different.

1) Drag and drop widgets to create a window
2) Double-click a widget to edit its code (presumably event handler)

I have used a number of GUI toolkits that did provide the first one,
but the second is a lot more restrictive than you might think: it
implies that there's exactly one code block per widget. For simple
projects, you might think "Uhh, yeah, a button has its click event",
but there are plenty of other events to attach to a button, and you
might want to have the same function attached to several buttons
(either because they actually do the same thing, or because they do
very similar things and it's parameterized). The nearest I've seen to
"double-click to edit code" is VX-REXX, which had a right-click menu
with all that widget's events; it didn't cope with having the same
code attached to multiple widgets (for that, you need to manually
attach events), but as that's a lot rarer than having multiple code
blocks attached to one widget (eg a hover event and a click event),
that's acceptable for a convenience feature.

As to dragging and dropping widgets to create a window, though...
that's fine for a pixel-based layout, but it's high time pixel-based
layouts were deprecated. They're vulnerable to way too many variations
(twip-based layouts, like VX-REXX uses, are at least independent of
font size, but still vulnerable to plenty of other issues), and
they're rigid. Cross-platform GUI toolkits are generally based around
rules, rather than exact positions, so you end up with a tree. Think
of HTML and how markup affects layout; you place containers and
containers within containers, and everything is held within its
parent. (Well, okay. With position:relative you can mess that up. And
of course position:absolute and position:fixed basically put a new
top-level window onto the page. But normal object layout is based on
the tree structure.)

Rather than a drag-and-drop builder, then, all you need is a text
editor and a way to quickly run your code. As well as demanding
nothing in terms of development time (believe you me, a good d'n'd
builder would cost quite a few dev hours), this guarantees perfect
accuracy; imagine the hassles if your code ended up producing
something not quite identical to your preview! Take the easy and safe
option, and just write your code and look at it. WYSIWYG editors have
their uses in some places, but more and more I'm seeing them as just
too restrictive. Editing text files is the way to do things.

ChrisA



More information about the Python-list mailing list