Re: [wxPython-users] Sizers API
by Chris Barker other posts by this author
Mar 24 2003 6:14PM messages near this date
Re: [wxPython-users] Sizers API
|
Re: [wxPython-users] Sizers API
"Patrick K. O'Brien" wrote:
> This change only effects code that uses the wxPython variants, and I
> wasn't able to find any examples that did. For instance, the examples
> on the wiki use Add(...), not AddWindow(...) or AddSizer(...).
That's because they are not documented or used iont he Demo. I wish I
knew they existed, as I would have used them. Personally, I find this
kind of overloading to be more confusing than helpful, so I'd ratyher
keep AddWindow(), AddSizer(), etc, and depricate the Add().
That being said, if we're going to keep the "overloaded" Add(), I do
like your change a lot. One thought is to have a "spacer" object, but if
there isn't anything useful to put in it other than two integers, then I
suppose that's a bit silly, and a tuple would be fine. After all, I can
always write code like:
SmallSpacer = (2,2)
...
MySizer.Add(SmallSpacer, ...)
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?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@[...].gov
---------------------------------------------------------------------
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
|