First off, thanks everyone for the quick (!) feedback. Responses
below.
The Bind function is hidden as in C++ it is more usual
to use the event macros to bind the events for you - so these are documented
an the actual event names and bind functions are usually not.
Is this practice different in python? If not, the sample should
probably be different. It makes more sense to show users how they're
supposed to do things in the examples & learning docs, vs. showing
them 'discouraged' or 'unpopular' methods. If there's a better way,
I'd love to use that instead. At any rate, even if a function is not
commonly used, it should probably still be possible to find the
documentation for it w/o jumping through too many hoops (even if it's
something like 'use X instead', which would be helpful).
Best of luck and enjoy learning Python and wxPython - from the sound of it
you are trying to do both at the same time - I was lucky that I have a lot
of experience of using wxWidgets in C and C++ before I met the old snake.
Thanks for the well wishes! I'm experienced in Python and C++, but
I'm trying to bite the bullet and finally learn GUI programming. It
is a bit confusing that wxPython docs seem less complete than the C++
version, which is understandable considering the history of the
projects. I'm trying to figure out where the problem lies, and if
there's anything I can do (as a newcomer) to help fix it.
You just need to keep following the class hierarchy. (which is shown
on the top of each classes documentation page).
i.e)
wxFrame Derives from TopLevelWindow, which in turn derives from
Window, ..., Derives from EvtHandler.
I think the flow might be broken here. If I go to the wxpython.org
docs link, then click on "Classes by category", then click on wxFrame,
I get to (http://docs.wxwidgets.org/stable/wx_wxframe.html#wxframe).
Then under "Derived from" I click on wxEvtHandler and get to (http://
docs.wxwidgets.org/stable/wx_wxevthandler.html#wxevthandler). There
is no mention of Bind() on that page at all, so from this we'd assume
that the wxEvtHandler class does not define a Bind() member function.
This is the problem with the docs I was referring to. That second
link I found mentions it, but there doesn't seem to be a way to get
there from the first docs. I'm trying to figure out why Bind() is on
the second docs and not the first, and how the first & second docs are
different, and how to get from one to the other.
Only the methods implemented directly by that class are shown on each
classes page, which makes it easier to reference things and prevents
duplication. Most api documentation is this way (see msdn for
example).
This style of docs makes it easier for the scenario, "I already know
the base object, so what new things does this derived class give me?"
It's less helpful for a newcomer's scenario, "What can I use this
class for?" In the second scenario, a newcomer (like me) is hindered
more by having to search through multiple pages of classes to find
what member functions are available, and how they relate, just to find
out "What can I do?" and "Which function should I use?". I've seen
other docs with this type of format:
class wxFrame
Member Functions:
a()
b()
c()
Inherited member functions
w() (from wxEvtHandler)
x() (from wxObject)
y() (from wxWindow)
z() (from wxWindow)
This makes it easy to tell at a glance everything that this class can
do (without having to already know 4 other base classes). It is
duplication of text, but it's also a lot more useful. And the amount
of duplication is very small; just a link to another page with an
anchor to that specific function. I like this method of docs, and
it's always seemed to help me learn libraries more quickly, and even
later when I know things it still helps to be able to reference a
single page for a single class, vs. multiple pages all the time.
wxPython is a Python wrapper around the C++ wxWidgets library. The
first set of documentation is for wxWidgets. The second link (New
Documentation) is the python specific documentation.
The first link I put was (wxWidgets: Documentation
wx_wxframe.html), and the second was (wxWidgets: Documentation
classwx_evt_handler.html). Both are on docs.wxwidgets.org, and both
seem to be for the C++ version of the wx framework. More confusingly,
these:
http://docs.wxwidgets.org/stable/wx_wxevthandler.html
http://docs.wxwidgets.org/trunk/classwx_evt_handler.html
Are two different docs for the same wxEvtHandler in C++. However, one
is a completely different style than the other, and only one mentions
Bind() at all (even though it should exist in both). Did the
documentation-generation backend change between the stable & trunk
versions? The question still remains, where is the documentation for
Bind() in the stable docs?
···
On Oct 14, 1:43 pm, <GadgetSt...@live.co.uk> wrote:
On Oct 14, 2:10 pm, Cody Precord <codyprec...@gmail.com> wrote:
--
Thanks for all your feedback, I've tried to learn wxPython a few times
but always gave up since the docs were very confusing. I'm trying to
stick it out so I can finally start enjoying GUI-goodness on my hobby
utilities that I keep writing. I hope that my criticisms are
constructive and not offensive, as I really do want to help improve
wxPython any way I can.