Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Pythonic cross-platform GUI desingers la

Reply
Thread Tools

Pythonic cross-platform GUI desingers la

 
 
Wolfgang Keller
Guest
Posts: n/a
 
      06-08-2012
> I want a gui designer that writes the gui code for me. I don't want to
> write gui code. what is the gui designer that is most popular?
> I tried boa-constructor, and it works, but I am concerned about how
> dated it seems to be with no updates in over six years.


Sorry to "hijack" your thread, but since this is a very related
question...

What "GUI designer" would come the closest to the way that Cocoa's
Interface Builder works? I.e. is there any one (cross-platform) that
allows to actually "connect" the GUI created directly to the code and
make it available "live" in an IDE?

This whole cycle of "design GUI"->"generate code"->add own code to
generated code"->"run application with GUI" has always seemed very
un-pythonic to me. A dynamic, interpreted language should allow to work
in a more "lively", "direct" way to build a GUI.

TIA,

Sincerely,

Wolfgang
 
Reply With Quote
 
 
 
 
CM
Guest
Posts: n/a
 
      06-08-2012
On Jun 8, 8:27*am, Wolfgang Keller <(E-Mail Removed)> wrote:
> > I want a gui designer that writes the gui code for me. I don't want to
> > write gui code. what is the gui designer that is most popular?
> > I tried boa-constructor, and it works, but I am concerned about how
> > dated it seems to be with no updates in over six years.

>
> Sorry to "hijack" your thread, but since this is a very related
> question...
>
> What "GUI designer" would come the closest to the way that Cocoa's
> Interface Builder works? I.e. is there any one (cross-platform) that
> allows to actually "connect" the GUI created directly to the code and
> make it available "live" in an IDE?
>
> This whole cycle of "design GUI"->"generate code"->add own code to
> generated code"->"run application with GUI" has always seemed very
> un-pythonic to me. A dynamic, interpreted language should allow to work
> in a more "lively", "direct" way to build a GUI.
>
> TIA,
>
> Sincerely,
>
> Wolfgang


I'm curious about your point but I don't really understand it. Could
you try again without using any scare-quoted words? Maybe given an
example of creating a small text editor application with a GUI builder/
IDE in this Pythonic way you are hoping for.

 
Reply With Quote
 
 
 
 
Dietmar Schwertberger
Guest
Posts: n/a
 
      06-09-2012
Am 08.06.2012 17:11, schrieb CM:
> I'm curious about your point but I don't really understand it. Could
> you try again without using any scare-quoted words? Maybe given an
> example of creating a small text editor application with a GUI builder/
> IDE in this Pythonic way you are hoping for.


Before anyone now writes "Good GUIs are coded by hand":
I agree, but for many purposes only simple GUIs are required
and it should be possible to create these without studying manuals
(on toolkit and GUI editor).
A typical simple GUI would e.g. be for a measurement / data aquisition
program, where you just need some buttons and fields.


I think that something in the style of Visual BASIC (version 6) is required
for either wxPython or PyQt/PySide (or both).
In the Visual BASIC editor you can e.g. add a GUI element
and directly go to the code editor to fill methods (e.g. an OnClick
method).
If you have not used VB before, you should just try it. You can create
GUIs within a few minutes even if you haven't used it before.
(Sure, the fact that anyone can use it has the side effect that most
of these GUIs are not good...)

Also:
Such an editor should support simple manual layouts without enforcing
the use of sizers (wx) or layout managers (Qt).
These add an additional level of complexity which is not required
for simple GUIs.


Background:
I'm using Python in a corporate environment but I'm more or less
the only one using it. I could propagate Python for wider use as it
is the best available language for things like hardware control and
data acquisition, but the lack of an easy-to-use GUI editor is
the blocking point. I can teach anyone how to create a program for data
acquisition, but I don't see how more than a few could create a GUI
without an easy-to-use tool.
There's still a lot of VB6 code around as there's no replacement and
this gap could well be filled by Python.


Regards,

Dietmar
 
Reply With Quote
 
CM
Guest
Posts: n/a
 
      06-09-2012
> I think that something in the style of Visual BASIC (version 6) is required
> for either wxPython or PyQt/PySide (or both).
> In the Visual BASIC editor you can e.g. add a GUI element
> and directly go to the code editor to fill methods (e.g. an OnClick
> method).


You can do this for wxPython with Boa Constructor easily. You can
bind an event handler for a wx.EVT_BUTTON to, e.g., "Button1" with Boa
and it will add this code for you to the bottom of your code:

def OnButton1Button(self,evt):
evt.Skip()

And you can than go in the code editor to that function and change the
code to do whatever you want.

> If you have not used VB before, you should just try it. You can create
> GUIs within a few minutes even if you haven't used it before.


Same with Boa.

> Such an editor should support simple manual layouts without enforcing
> the use of sizers (wx) or layout managers (Qt).
> These add an additional level of complexity which is not required
> for simple GUIs.


Same with Boa, though it also has good support for sizers which
generally should be required for anything other than the simplest
GUIs.

> data acquisition, but the lack of an easy-to-use GUI editor is
> the blocking point. I can teach anyone how to create a program for data
> acquisition, but I don't see how more than a few could create a GUI
> without an easy-to-use tool.
> There's still a lot of VB6 code around as there's no replacement and
> this gap could well be filled by Python.


In addition to Boa, I get the sense that the other tools mentioned
here are also good, so is this "blocking point" real?

 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      06-09-2012
On Sat, Jun 9, 2012 at 11:25 PM, Dietmar Schwertberger
<(E-Mail Removed)> wrote:
> ... for many purposes only simple GUIs are required
> and it should be possible to create these without studying manuals
> (on toolkit and GUI editor).
> A typical simple GUI would e.g. be for a measurement / data aquisition
> program, where you just need some buttons and fields.
>
>
> If you have not used VB before, you should just try it. You can create
> GUIs within a few minutes even if you haven't used it before.
> (Sure, the fact that anyone can use it has the side effect that most
> *of these GUIs are not good...)


There's an assumption in most of the Windows world that everything
needs a GUI. For a simple data acquisition program, I wouldn't use one
- I'd have it run in a console. That's something that any programmer
should be able to create without studying complex manuals; all you
need to know is the basics of I/O and possibly argument parsing.

I've used Visual Basic. My first salaried work was on VB. Making it
easy to throw together a simple GUI doesn't mean a thing when you have
a large project to write - your business logic and UI design work will
massively dwarf the effort of actually throwing widgets into a
hierarchy. So the only time it's going to be an issue is with trivial
programs; which means there isn't much to be saved. Just make your
trivial things run in a console, and then either use a GUI builder
(several have been mentioned) or hand-write your UI code.

Actually, there's a third option these days. Give it no console and no
GUI, make it respond to HTTP connections, and use a web browser as
your UI.

ChrisA
 
Reply With Quote
 
Dietmar Schwertberger
Guest
Posts: n/a
 
      06-09-2012
Am 09.06.2012 17:34, schrieb CM:
> You can do this for wxPython with Boa Constructor easily. You can
> bind an event handler for a wx.EVT_BUTTON to, e.g., "Button1" with Boa
> and it will add this code for you to the bottom of your code:
>
> def OnButton1Button(self,evt):
> evt.Skip()
>
> And you can than go in the code editor to that function and change the
> code to do whatever you want.

Having to go there is already more work than I would expect.
I would expect to go there e.g. by a double-click.

This is just a minor point, but many minor points sum up...

If you take maybe 10 people each with some BASIC or Python knowledge,
I would bet that you can teach most of them how to write a
simple GUI program in VB within five minutes, but you'll probably fail
with Boa. (And even then you would have to re-teach them in a few
months when they try to write their next program.)


>> If you have not used VB before, you should just try it. You can create
>> GUIs within a few minutes even if you haven't used it before.

>
> Same with Boa.

Not for me when I tried Boa.
The logic / usage concept behind is not exactly straightforward.
At the time, Boa was suggested to be the perfect choice for previous
Delphi users. Maybe my problem was that I did never use Delphi.
(Only Turbo Pascal in the pre-gui era...)


>> Such an editor should support simple manual layouts without enforcing
>> the use of sizers (wx) or layout managers (Qt).
>> These add an additional level of complexity which is not required
>> for simple GUIs.

>
> Same with Boa, though it also has good support for sizers which
> generally should be required for anything other than the simplest
> GUIs.

Yes, at least Boa left the choice to the user.
Some of the other tools even insist on sizers at places where they are
not even required with a sizer-based layout.
(E.g. with wx you usually place a notebook directly on a frame while
some tools insist on using a sizer first.)


> In addition to Boa, I get the sense that the other tools mentioned
> here are also good, so is this "blocking point" real?


I've tried several:
wxDesigner, Boa, QtCreator, wxFormBuilder, wxGlade,
None of these were such that I could propagate it as GUI development
tool for non-programmers / casual users.
Sure, some are good for designing the GUI, but at the point where
the user code is to be added, most people would be lost.
(I think that was the point that Wolfgang did not like and did describe
as un-pythonic.)


Also, another requirement for this purpose would be that the tool
is under active development. This would e.g. rule out Boa.

I would not care whether the tool is freeware or commercial.
Being freeware would make handling easier, though (e.g. deployment to
all measurement PCs by just running it from a file share is
easier than local installations and license handling).


Regards,

Dietmar
 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      06-09-2012
On Sun, Jun 10, 2012 at 3:07 AM, Dietmar Schwertberger
<(E-Mail Removed)> wrote:
> None of these were such that I could propagate it as GUI development
> tool for non-programmers / casual users.
> Sure, some are good for designing the GUI, but at the point where
> the user code is to be added, most people would be lost.


There was a time when that was a highly advertisable feature - "build
XYZ applications without writing a single line of code!". I've seen it
in database front-end builders as well as GUI tools, same thing. But
those sorts of tools tend not to be what experts want to use. You end
up having to un-learn the "easy way" before you learn the "hard way"
that lets you do everything.

You refer to "non-programmers" and then point out that they would be
lost trying to add code. That's a natural consequence of not being a
programmer, and of all languages to help someone bridge that gap and
start coding, I would say Python is, if not the absolute best,
certainly up there somewhere. Just as you wouldn't expect a music
authoring program to let someone publish score without knowing how to
compose music, you can't expect a GUI tool to relieve you of the need
to write code.

WYSIWYG UI designers suffer badly from a need to guess _why_ the human
did what s/he did. Build your UI manually, and there's no guesswork -
you explicitly _tell_ the computer what to do and why.

ChrisA
 
Reply With Quote
 
rusi
Guest
Posts: n/a
 
      06-10-2012
On Jun 9, 10:07 pm, Dietmar Schwertberger <(E-Mail Removed)>
wrote:
> > And you can than go in the code editor to that function and change the
> > code to do whatever you want.

>
> Having to go there is already more work than I would expect.
> I would expect to go there e.g. by a double-click.
>
> This is just a minor point, but many minor points sum up...
>
> If you take maybe 10 people each with some BASIC or Python knowledge,
> I would bet that you can teach most of them how to write a
> simple GUI program in VB within five minutes, but you'll probably fail
> with Boa. (And even then you would have to re-teach them in a few
> months when they try to write their next program.)


This is worth a read in this context: http://osteele.com/archives/2004/11/ides
 
Reply With Quote
 
Arnaud Delobelle
Guest
Posts: n/a
 
      06-10-2012
On 10 June 2012 07:16, rusi <(E-Mail Removed)> wrote:

> This is worth a read in this context: http://osteele.com/archives/2004/11/ides


Interesting! I definitely fall nicely at one extreme of this
dichotomy. Every time I've tried to use an IDE, it's made me feel
inadequate and I've quickly retreated to my comfort zone (emacs +
xterm). I felt inadequate because I felt like the IDE was hindering
me rather than helping me. All I ask from the program that I use to
write code is:

* syntax highlighting
* sensible auto-indenting
* as little reliance on the mouse as possible
* emacs key bindings

This article makes me feel more positive about my inability to feel
comfortable in an IDE. Thanks for the link!

--
Arnaud
 
Reply With Quote
 
Dietmar Schwertberger
Guest
Posts: n/a
 
      06-10-2012
Am 10.06.2012 08:16, schrieb rusi:
> This is worth a read in this context: http://osteele.com/archives/2004/11/ides

So which language would you suggest to use next?

I've read the article. It presents some nice ideas, but probably the
author has not used Python before.
Otherwise he would have noticed that the overall productivity does not
only depend on language and IDE/editor, but on the complete environment
which in the case of Python includes the ability to use the interpreter
interactively. For many tasks that's a major productivity boost.
But that's a point that many people don't see because their current
language like C# or Java does not have an interpreter and when they
just look at the syntax, the find "there's not enough improvement to
switch".

Also, I'm not sure whether the author counts the libraries as language
or tool feature. In my opinion the environment and the libraries should
be listed on their own in such an article. Libraries are developed
after the language, but usually they are ahead of the other tools/IDEs.


The author lists many IDE features that I personally don't find too
important (the refactoring capabilities of a simple text editor are
fine for me...). But following the link to Laszlo made the reason quite
clear because his IDE background is from Eclipse not from Python.


Btw.: I've been using Python for 16 or 17 years now. Only 3 years ago I
did the switch from Editor to IDE (Wing IDE) and this has brought a
*significant* boost of productivity (especially the good debugger allows
you to code in a different way as you can use the interactive
interpreter at any point in your program).



But back to my original point, this time in the context of the article:
If you want to 'sell' a programming language for corporate use, you
absolutely need the tools. And this includes an easy-to-use GUI editor
which does not only allow to create the GUI, but also to fill it with
code.
Most corporate users are casual users, not full time programmers.



Regards,

Dietmar
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Pythonic cross-platform GUI desingers la Interface Builder (Re: what gui designer is everyone using) Dietmar Schwertberger Python 5 06-25-2012 10:15 PM
Re: Pythonic cross-platform GUI desingers la Interface Builder (Re: what gui designer is everyone using) Dietmar Schwertberger Python 5 06-15-2012 11:35 PM
Re: Pythonic cross-platform GUI desingers la Interface Builder (Re: what gui designer is everyone using) Chris Angelico Python 1 06-14-2012 06:43 PM
Object Oriented vs Pythonic Code, and Pythonic standards Carl J. Van Arsdall Python 4 02-07-2006 10:15 PM
-- Pythonic control of Windows GUI application: tabs and listviews zapazap Python 2 01-26-2004 10:54 PM



Advertisments