The nice thing about the API doc is that it shows all things supported
by wxPython, so things in wxWidgets which are not wrapped in wxPython
are NOT shown.
The signature (correct term?) of each method is documented, however what
is missing is explanation on how things are used.
Exactly. Signatures are autogenerated from the code, so they are all there.
And explanation is missing, yes. Sometimes one can guess the datatypes
and figure out what should be passed and what is returned by looking
at the names, but when you see stuff like
AddSpacer(self, *args, **kw)
without explanation there's obviously some lack of documentation
(which I imagine is the biggest hurdle for people that are thinking
about using wxPython -- lack of clear documentation).
Check also the
changes.txt with wx 2.6.1:
Quote:
wx.Sizer.AddWindow, AddSizer, AddSpacer and etc. have now been
undeprecated at the request of Riaan Booysen, the Boa Constructor team
lead. Boa needs them to help keep track of what kind of item is being
managed by the sizer. They are now just simple compatibility aliases
for Add, and etc.
EndQuote
That I had not seen (seems like it appeared in 2.5.4.1 btw). That
answers the question "why do the deprecated methods still work?". I
guess the reason for deprecating them in the first place were that you
can pass the exact same argument (size-tuple) to Add and get the same
result in wxPython (you can't send a wxSize or an int to Add in the
wxWidgets -- only two ints). However, I just looked a bit closer at
wxWidgets' AddSpacer and it appears it's just for quadratic spacers:
More readable way of calling Add(size, size, 0)
And so that's why it only takes one int instead of a wxSize (or two
ints). Silly of me not noticing that. (I will not question why
wxPython doesn't have a simple method for doing quadratic spacers,
since I think those are silly :)) Anyway, I'll just use the Add and
pass it a size-tuple. I still feel the documentation could be clearer
though (how about just copying that part from the changelog to the
AddSpacer, AddWindow and AddSizer methods in the wxPython manual?)
//Jonatan