Kevein, you must have been expecting this note from me... didn't you
declare me the official sizer nag a while back?
Kevin Altis wrote:
I don't have a clue right now how to do an intuitive sizer layout builder.
wxDesigner works, but most of the layouts I've done with it have been a
trial of my patience, it certainly isn't simple.
Difficult things aren't simple to do. I'm not just trying to be cute,
auto sizing layout is an inherently difficult thing to wrap your head
around. I've just started using wxDesigner, and after using it a bit, I
find it much less frustrating. It is certainly easier that using sizers
by hand, because you can get almost instant feedback when you do
something, and you don't need to rememeber what all those flags mean. A
little more documentation would help a lot (just how do you use a
splitter window?). Using sizers
For now, I find it easier to do a fixed layout, then push it into a sizer afterwards.
Ahh, this sounds similar to what we have found: Despite its name,
wxDesigner is NOT a good tool for designing GUI layouts. It order to use
it effectively, you have to have your layout designed first, and then
use wxDesigner to put it together. This is partly because you have to
build things from outside in, rather than inside out. I do think it
could be altered a little to make it easier to add a sizer around an
existing object, that would help.
For an easy to use tool, I suppose the ideal might be to allow either
sizers or fixed layout, much like wxWindows itself does. I am wary of
this, however, new users will find it easier to use fixed layout, and
therefor never learn to use sizers, and in the long run, they will
suffer for it. It's a tough call. I have a theory about so called
usability:
Most people define usability in terms of how steep the learning curve is
when the first pick up the tool: A usable tool is one you can do
something useful with soon afer you start using it. I prefer to define
usability in terms of overall productivity: how much can I get done with
how much effort, over the life of my using the tool. As a rule, I've
found that things that have the easiest learning curve at the begining,
stifle my productivity in the long run. I think this very much applies
here.
The problem, of course, is that it is hard to purswade someone that a
tool will make them highly productive when they can't do a damn thing
with it when they first pick it up!
As a simple example, the PythonCard event handling takes care of event
binding for the user/programmer. Rather than needing an EVT_BUTTON() setup
and a separate method to handle the actual button click like OnMouseClick,
all you have to put in your code is a handler like:
def on_btn1_mouseClick(self, target, event):
print "hello", target.name
All of the mouse events, selection, key presses, etc. for the base widgets
are setup automatically by PythonCard. At runtime, the event system searches
for methods with the special names and does the binding for you.
I think this is great, and just what wxPython needs. I've always thought
that wxPython was not very Pythonesque. In a dynamic language, it should
be much easier to put in a button, and assign something to do when it is
clicked.
Another option would be to assign the methods to call when defining the
button:
mybutton = ButtonConstructor(parent, position_info,
mouseclickfunc = self.afunc,
mouseoverfunc = self.anotherfunc)
Python's keyword arguments would make this managable, and it would allow
people to use function names that make sense to them, and to allow
different widgets and actions call the same function. This is just an
idea, I havn't thought it through yet...
I do think this is a very valuable project, I hope you can find the time
and support you need to get it to fly.
-Chris
···
--
Christopher Barker,
Ph.D.
ChrisHBarker@home.net --- --- ---
http://members.home.net/barkerlohmann ---@@ -----@@ -----@@
------@@@ ------@@@ ------@@@
Oil Spill Modeling ------ @ ------ @ ------ @
Water Resources Engineering ------- --------- --------
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------