Re: [wxPython-users] Sizers API
by Donnal Walter other posts by this author
Mar 24 2003 7:59PM messages near this date
Re: [wxPython-users] Sizers API
|
Re: [wxPython-users] Sizers API
Patrick K. O'Brien:
> Chris Barker:
> > A couple of years ago, I wrote a little treatise on wx-dev
> > about a nicer API for sizers. Being a Pythonista, and having
> > only a smattering of C++ knowledge, I came up with something
> > that used a lot of keyword arguments, and really couldn't be
> > implimented in C++, but would have been pretty nive for
> > Python. Robin expressed interest in including it if I wrote
> > it, but of course, I never got around to it.
> >
> > Is there interest in a thicker wrapper around Sizers that will
> > make them easier to understand, I'll try to dig up that email
> > and we can start the discussion. The obvious downside is that
> > then wxPython Sizers would have a different API than wxWindows
> > sizers, and that would have impilcations for docs and GUI
> > builders.
> >
> > Should I persue this? Are folks interested?
>
> I'm definitely interested. I think it's at least worth
> discussing. I don't think wxPython programs make enough use
> of sizers, in part because they aren't documented sufficiently
> and explained enough. I'm working on docs and examples now. But
> a more Pythonic implementation might help as well. Perhaps as
> an alternative on top of, or in addition to, the implementation
> that mirrors the wxWindows API.
Sizers are extremely powerful, but it is common knowledge that they
can be equally confusing. IMHO there are two reasons for this
confusion. The first reason is that the arguments are far from
intuitive and perhaps Chris's API would help with this. (I have
taken a similar approach and implemented three keyword arguments:
resize, margin, and align.)
But the second source of confusion is that if one uses nested
windows (panels) and nested sizers to any degree, one ends up with
two entirely different containment hierarchies. The way I have
handled this is to build sizers into my panels, so that adding a
component to the panel automatically adds it to the sizer. No muss,
no fuss.
=====
Donnal Walter
Arkansas Children's Hospital
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@[...].org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Thread:
Patrick K. O'Brien
Chuck Esterbrook
Robin Dunn
Alberto Griggio
Bill Anderson
Patrick K. O'Brien
Donnal Walter
Chris Barker
Patrick K. O'Brien
Donnal Walter
Patrick K. O'Brien
David C. Fox
Patrick K. O'Brien
Robin Dunn
Donnal Walter
Patrick K. O'Brien
|