Discussion:
Which RAD? Boa, or Glade, or Card, or...
Michael Huster
2005-07-14 18:05:32 UTC
Permalink
I am intersted in starting GUI programming. There are several GUI builders/RAD's avaliable for wxPython: Boa-constructor, wxGlade, PythonCard, + others? Can you give me help on the pros/cons of each? (Or is this a religious question?)

Michael Huster, Ph. D.
Assistant Professor of Science
Simpson University
2211 College View Dr.
Redding, CA 96003
Stephen Waterbury
2005-07-14 18:32:59 UTC
Permalink
Post by Michael Huster
I am intersted in starting GUI programming.
Boa-constructor, wxGlade, PythonCard, + others? Can you give
me help on the pros/cons of each? (Or is this a religious question?)
For some it might be considered religious, but I think it is
a matter of 2 things: (1) what fits your brain best and
(2) what type of application you are developing.

PythonCard is nice and very quick to get started with.
I like it, but I don't use it because I need some things
that can only be done directly in wxPython. I don't use
a GUI builder except for cases in which I need to figure
out the proper syntax for doing something complicated with
sizers, in which case I've found wxGlade to be extremely
useful -- I mock up a simple case of what I need in
wxGlade, generate the code, and then use those patterns
in my own code.

Best thing to do is read their docs, try out a few, and
see what you like.

Cheers,
Steve
Steve Milner
2005-07-14 18:35:50 UTC
Permalink
Good Day Michael,

It is somewhat of a religious question. While I can't comment on Card
(havn't tried it) I have tried both glade and boa. I personnally like
Boa-constructor but that doesn't mean you will ;-P. The best thing you
can do is grab one and give it a shot, if you like it great! If not, try
another.

Steve
Post by Michael Huster
I am intersted in starting GUI programming. There are several GUI builders/RAD's avaliable for wxPython: Boa-constructor, wxGlade, PythonCard, + others? Can you give me help on the pros/cons of each? (Or is this a religious question?)
Werner F. Bruhin
2005-07-14 19:10:32 UTC
Permalink
Post by Michael Huster
I am intersted in starting GUI programming. There are several GUI builders/RAD's avaliable for wxPython: Boa-constructor, wxGlade, PythonCard, + others? Can you give me help on the pros/cons of each? (Or is this a religious question?)
Probably! ;-)
I use and like Boa as it is an IDE and not just a GUI designer, I
especially like the debugger.

You might want to search the archive of this list for "IDE - choice?"
you get about 20+ postings.

I would download some or all and play around with them and post
questions to the approriate lists if you have a problem and/or question.

You might also want to look at Dabo.

See you
Werner
Post by Michael Huster
Michael Huster, Ph. D.
Assistant Professor of Science
Simpson University
2211 College View Dr.
Redding, CA 96003
---------------------------------------------------------------------
James Besemer
2005-07-14 20:06:47 UTC
Permalink
Post by Werner F. Bruhin
I use and like Boa as it is an IDE and not just a GUI designer, I
especially like the debugger.
I myself downloaded Boa the other day, installed and ran it and was unable to figure it out in the short amount of time allotted.

I was left with a particular question: does Boa allow you to "draw" UI panels like VisualC++? Or do you still have to glue everything together with code? If you can compose a GUI with your mouse, can you point me to a tutorial or howto that would help get me started?

If Boa does not work this way, is there a tool that does?

TIA

--jb
Werner F. Bruhin
2005-07-15 08:13:31 UTC
Permalink
Hi James,
Post by James Besemer
Post by Werner F. Bruhin
I use and like Boa as it is an IDE and not just a GUI designer, I
especially like the debugger.
I myself downloaded Boa the other day, installed and ran it and was unable to figure it out in the short amount of time allotted.
I was left with a particular question: does Boa allow you to "draw" UI panels like VisualC++?
YES!
Post by James Besemer
Or do you still have to glue everything together with code? If you can compose a GUI with your mouse, can you point me to a tutorial or howto that would help get me started?
Did you get the 0.4.4 release of Boa? If yes then you the
documentation, otherwise download the separate documentation or get
0.4.4 then check out the Boa Constructor Getting Started Guide which
contains a tutorial. If you do the tutorial and have suggestions on how
to improve it please post to newsgroup
"gmane.comp.ide.boa-constructor.user".

See you
Werner
Post by James Besemer
If Boa does not work this way, is there a tool that does?
TIA
--jb
---------------------------------------------------------------------
Matt Kubilus
2005-07-18 12:20:29 UTC
Permalink
Tried BoaConstructor, found the code it created a bit too messy.
Interweaves code with layout too much. This makes programs very hard
too maintain. I found myself afraid to change the layout of panels
for fear that I will break something. And if you add GUI stuff in by
hand, you can kiss goodbye visual layout for that form. However,
Boa-Constructor is a very strong IDE and is probably the most
approachable choice.

I've been using pyalamode and wxGlade for GUI. I compile everything
as XRC so my code is seperated from the GUI. I like that. wxGlade
kind of forces sizers on you, which is a bit difficult to get the hang
of at first, but leads to *much* nicer looking layouts and more
professional apps once you get the hang of it. PyAlaMode is okay. . a
bit light in the features department (No find/replace!?!?!)

--Matt
Werner F. Bruhin
2005-07-18 12:42:27 UTC
Permalink
Hi Matt,
Post by Matt Kubilus
Tried BoaConstructor, found the code it created a bit too messy.
Messy?
Post by Matt Kubilus
Interweaves code with layout too much.
Can you expand on this, i.e. give an example. In my view Boa "just"
generates GUI code (inclusive events) the rest of the code is yours and
it is up to you/me on how to organize it. I made some stupid/newbie
mistakes in my stuff but that is my inexperience and I don't think it is
Boa's problem.
Post by Matt Kubilus
This makes programs very hard
too maintain. I found myself afraid to change the layout of panels
for fear that I will break something. And if you add GUI stuff in by
hand, you can kiss goodbye visual layout for that form.
Have you come across another GUI editor were you can change things
within the generated code sections and don't have to be carefull what
you do?

Whenever I change layout I use the Boa Frame Designer - at least in most
cases, certain repetetive changes I do manually and just be careful to
use the same syntax Boa would use/generate.

See you
Werner
Post by Matt Kubilus
However,
Boa-Constructor is a very strong IDE and is probably the most
approachable choice.
I've been using pyalamode and wxGlade for GUI. I compile everything
as XRC so my code is seperated from the GUI. I like that. wxGlade
kind of forces sizers on you, which is a bit difficult to get the hang
of at first, but leads to *much* nicer looking layouts and more
professional apps once you get the hang of it. PyAlaMode is okay. . a
bit light in the features department (No find/replace!?!?!)
--Matt
---------------------------------------------------------------------
Sandip Bhattacharya
2005-07-18 12:49:44 UTC
Permalink
Post by Matt Kubilus
I've been using pyalamode and wxGlade for GUI. I compile everything
as XRC so my code is seperated from the GUI. I like that. wxGlade
kind of forces sizers on you, which is a bit difficult to get the hang
of at first, but leads to *much* nicer looking layouts and more
professional apps once you get the hang of it. PyAlaMode is okay. . a
bit light in the features department (No find/replace!?!?!)
Another way to work with wxglade is to store the UI in its native
wxglade format only and to generate python code using it.

Now here is something different from what the wxglade tutorials tell
you. Do *not* work on this generated python code at all. Instead
subclass them in separate files, and add event handlers in *them*. That
way, you will have pure python sources for everything, and UI still in
separate files. The idea of storing wxglade native files is to
regenerate/modify the GUI code when required.

Somehow generating python sources for GUI seems better for two reasons -
one, it "seems" faster to load. Two, when you package it in, say
Windows, the UI is seamlessly inside your exe files rather than a
separate user-muckable resource.

- Sandip
--
Sandip Bhattacharya * Puroga Technologies * ***@puroga.com
Work: http://www.puroga.com * Home/Blog: http://www.sandipb.net/blog

PGP/GPG Signature: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3
the_shelter
2005-07-18 13:50:55 UTC
Permalink
Hi,

am I the only one that feels that the neverending discussion about
'which editor is best, should I use' gets a little bit annoying?
We've had this discussion several times (and I also took part in them), only last month for example
...
So please, read the old posts in the archive 1st- doing this you'll
find that all suggestions are and will ever be only personal opinions.

As whith experiences: it's good to share experiences, but in the end
everybody will have to make their own ones.

Hope I didn't step on someone's feet too hard, bit there are couple of
'how to start out'- sections on every editor's page...

Cheers,

the_shelter mailto:***@the-shelter.de
Franz Steinhäusler
2005-07-18 13:45:44 UTC
Permalink
Post by the_shelter
Hi,
am I the only one that feels that the neverending discussion about
'which editor is best, should I use' gets a little bit annoying?
We've had this discussion several times (and I also took part in them), only last month for example
...
Programs evolve and change.

So every now and then, I find it justified to discuss this.

Second: only a few wxPython user make here the contributions.
So if you ask another date, the likelihood, that some other
users make some contribution, is also an advantage.

With only one thread, I wouldn't have learned so much, and
I find it quite interesting, what other people use or what approach
they take.
Post by the_shelter
So please, read the old posts in the archive 1st- doing this you'll
find that all suggestions are and will ever be only personal opinions.
ACK
Post by the_shelter
As whith experiences: it's good to share experiences, but in the end
everybody will have to make their own ones.
Ok
Post by the_shelter
Hope I didn't step on someone's feet too hard, bit there are couple of
'how to start out'- sections on every editor's page...
Cheers,
--
Franz Steinhaeusler
Wyant, Jaime
2005-07-18 13:54:00 UTC
Permalink
-->-----Original Message-----
-->From: Sandip Bhattacharya [mailto:***@lug-delhi.org]
-->Sent: Monday, July 18, 2005 7:50 AM
-->To: wxPython-***@lists.wxwidgets.org
-->Subject: Re: [wxPython-users] Which RAD? Boa, or Glade, or Card, or...
-->
[ snip! ]
-->
-->Another way to work with wxglade is to store the UI in its native
-->wxglade format only and to generate python code using it.
-->
-->Now here is something different from what the wxglade tutorials tell
-->you. Do *not* work on this generated python code at all. Instead
-->subclass them in separate files, and add event handlers in *them*. That
-->way, you will have pure python sources for everything, and UI still in
-->separate files. The idea of storing wxglade native files is to
-->regenerate/modify the GUI code when required.
-->
-->Somehow generating python sources for GUI seems better for two reasons -
-->one, it "seems" faster to load. Two, when you package it in, say
-->Windows, the UI is seamlessly inside your exe files rather than a
-->separate user-muckable resource.

I used to use wxGlade to generate class files like you recommend. However,
I typically break my app into various packages; one for dialogs, another for
panels, etc.

I found these steps faster than my wxGlade development cycle:

1) Edit xrc resource with xrced
2) Run app - see changes

Because wxGlade would require me to copy files around to the correct
directories, I'd have an additional step ->
1) Edit gui with wxGlade
2) Run script to copy files to correct place
3) Run app - see changes

Not to mention I'd have to edit the "copy script" each time I added a new
dialog / panel / etc.

I also find xrced to be more stable than wxGlade. Not that wxGlade would
blow up, but it would sometimes have issues laying out items. XRC seems to
be really stable in regards to laying out widgets.

I *do* like that wxGlade gives you access to widgets by the name you gave
them. For instance -> mypanel.my_text_ctrl.SetValue("Woohoo!").

I have to go around the world to make my controls accessible as member
variables. (If anyone has a better way, please let me know). What I do is
name my controls appropriately via their XML ID. For instance I may name a
wxTextCtrl username_txt.

After naming each of the controls, I load the panel from the xml resource.
I pass the panel to the function below. The docstring ought to explain
what's going on. I have another function I use for attaching "unknown"
controls.

def attach_controls(window, instance):
"""Finds all child windows that are derived from wx.Control and makes
them a property of `instance' based on their name.

For instance, if a choice is named 'my_choice' in XRCed, then that same
choice will become a property of `obj' after calling
attach_controls(window, obj)
"""
for w in window.GetChildren():
if isinstance(w, wx.Control):
name = w.GetName()
# XRCED gives unnamed controls a default name of `-1'
if name == "-1":
continue

exec "instance.%s = xrc.XRCCTRL(window, '%s')" % (name ,name)

just my .02.

jw
Matt Kubilus
2005-07-19 20:22:31 UTC
Permalink
Post by Werner F. Bruhin
Can you expand on this, i.e. give an example
Well . . Boa doesn't do resource files. XRC is a type of resource
file, similar in scope as to what resource file in MFC are used for.
XRC however is in XML so it is just plain better : )
There is a reason resource files are used in many other programming
IDEs, languages, development environments etc. Resource files allow
the logic of you code to be loosly coupled (to use a CS term) with
the layout of your app.

THis is also the same idea behind having a seperate CSS file instead
of embedding all the layout in the HTML file. Latex, same idea.
Seperate content from layout.

So, if I create my dialog in XRC then to get at it I do something like
the following:

#-------------------------------------------------------------------------------->
class addMachineDialog(wx.Dialog):
def __init__(self, parent, db):

#-------------------------------------------
#
# Dialog Initialization
#

self.db = db
self.parent = parent
self.res = wxXmlResource("addMachineDialog.xrc")
self.dialog = self.res.LoadDialog(self.parent, "addMachineDlg")
self.dialog.SetReturnCode(-999)
self.PostCreate(self.dialog)

self.machineNameTXT = XRCCTRL(self, "machineNameTXT")
self.panelTXT = XRCCTRL(self, "panelTXT")

self.cancelBTN = XRCCTRL(self, "cancelBTN")
self.addBTN = XRCCTRL(self, "addBTN")
self.findBTN = XRCCTRL(self, "findBTN")

self.cancelBTN.Bind(wx.EVT_BUTTON, self._cancel)
self.addBTN.Bind(wx.EVT_BUTTON, self._add)
self.findBTN.Bind(wx.EVT_BUTTON, self._find)


def PostCreate(self, pre):
self.this = pre.this
self.thisown = pre.thisown
pre.thisown = 0
if hasattr(self, '_setOORInfo'):
self._setOORInfo(self)
if hasattr(self, '_setCallbackInfo'):
self._setCallbackInfo(self, self.__class__)

#<---------------------------------------------------------------------------------

The above will load my xrc file, grab the relevant controls and make
all the controls members of the addMachineDialog class. There are
other ways to do this, but I like simplicity.

Now, if I want to change the layout, I edit it in wxGlade or XRCed (a
matter of preference really, both are equally good.) and generate the
XRC file. If I need to change the logic of my code, I change it
without fear of messing up what a form designer might do. It's not
that you can't do the exact same thing with Boa, it's just that you
end up with much cleaner, more modular, testable and maintainable
code. I've done this both ways, I have a fairly large python app
written using Boa and one using wxGlade. I'm afraid to touch the Boa
app, The wxGlade is actually a bigger app but is much more
maintainable.

Try and see what works for you,
Matt

Loading...