Re: [wxPython-users] Sizers API
by Patrick K. O'Brien other posts by this author
Mar 24 2003 9:11PM messages near this date
Re: [wxPython-users] Sizers API
|
Re: [wxPython-users] Sizers API
"David C. Fox" <davidcfox@[...].edu> writes:
> Patrick K. O'Brien wrote:
>
> > More unfortunate is the option parameter, which only applies to
> > BoxSizer, but is defined in the Sizer parent class, and isn't easily
> > ignored because it is the second parameter and comes before the flag
> > and border parameters. And the wxWindows docs don't call it option,
> > they call it proportion, which is a bit more descriptive since it
> > determines the proportion of space allocated to the item in relation
> > to the space requested by all items in that particular BoxSizer.
> > I'm starting to think the entire sizer API is ripe for an overhaul.
> > If ever there was a place to deviate from wxWindows, surely this is a
> > pretty good one.
>
> I've never seen the point of defining Add in wxSizer if it doesn't
> have the same interface in all subclasses.
I think it belongs in Sizer, without the option parameter, which
should be addded in BoxSizer. It's quite possible to implement it
that way in wxPython, in spite of the choices made by wxWindows. In
this particular example I think it would be good to deviate from
wxWindows. Having to specify a option parameter for the Add method of
classes that don't support an option parameter is silly, wasteful, and
confusing.
> Personally, I'd rather see the sizer API fixed in wxWindows as well
> (with appropriate backward compatibility), but I don't know what the
> chances of that happening are. By the way, there has been a lot of
> discussion on the wx-users list lately of suggestions for wxWindows 3
> (including a wx namespace with wx::Frame, etc.) so it would probably
> make sense for some of the principals here to be involved in that
> discussion as well.
I agree, but I've only got so much time and energy. Personally, I'd
just as soon fix things in wxPython and let the wxWindows folks catch
up to us. While I'd like the APIs of the two projects to be as close
as possible, in the end I think good design should prevail and is more
important than strict compatibility. But that's just my own personal
opinion.
(Of course, we're not strictly compatible as it is. We call
"proportion," "option," and we introduce a bunch of additional methods
to deal with overloading. Why not take the next step and drop
"option" from everything but BoxSizer? Why not split up the flags
parameter into a more logical grouping?)
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com/web/pobrien
-----------------------------------------------
"Your source for Python programming expertise."
-----------------------------------------------
---------------------------------------------------------------------
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
|