Re: [wxPython-users] Sizers API
by Donnal Walter other posts by this author
Mar 24 2003 6:35PM messages near this date
Re: [wxPython-users] Sizers API
|
Re: [wxPython-users] Sizers API
--- "Patrick K. O'Brien" <pobrien@[...].com> wrote:
>
<snip>
> I find the current solution inelegant and verbose. So I'd like
> to propose the following change. If you look at the preceding
> example you'll see the the various Add* signatures are very
> similar. The only real problem is the spacer variation which
> requires two initial parameters -- width and height. But if we
> express these as a tuple, then all the signatures will have the
> same number of elements.
>
> So what I would like to see is the elimination of the Add*
> variations, leaving a single Add method that looks like this:
>
> def Add(self, item, option=0, flag=0, border=0,
> userData=wx.NULL):
> """Add item to sizer. Item is either a window, sizer, or
> (width, height) tuple representing the size of a
> spacer."""
>
> The code for this Add method would check the type of the first
> item and respond accordingly. In order to maintain backward
> compatibility, the actual code will still have to allow the old
> spacer signature to work, but I don't think we should document
> it or encourage its use. New code examples should use a (width,
> height) tuple instead.
<snip>
> Issues
> ======
>
> None of the wxPython variants are documented in the wxWindows
> manual, so no changes are needed there.
>
> As you've no doubt heard me say before, I believe sooner is
> better than later and would like to make this change now.
>
> 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(...).
>
> Boa doesn't use sizers, so this change won't effect Boa.
>
> I don't know what the other designers do with sizers. Anyone?
I make extensive use of sizers in Mindwrapper, and I consider this
change to be a good thing. It would break my code in one spot, but
the fix would actually SIMPLFY my code substantially.
>
> Opinions
> ========
>
> What do the rest of you think about this proposal?
Definitely +1
> What issues have I missed?
Can't think of any.
Thanks.
=====
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
|