Entry
Does anyone know of any wxpython tutorial / good medium sized program to learn from?
Mar 1st, 2002 05:15
Denny De La Haye, unknown unknown, http://wxpython.org/tutorial.php http://wiki.wxpython.org/
wxPython now has a Wiki site as well: http://wiki.wxpython.org/
-----
The tutorial mentioned below has been moved to:
http://wxpython.org/tutorial.php
You might as well go and look at it, but it's pretty useless, and not
even finished. What you probably need (and what I definitely need!) is
something in between this very simple tutorial and the overly complex
demo code.
-----
There is the beginings of one here: http://wxpython.org/tutorial.html.
The demo distributed with wxPython is meant to be a teaching tool
although it needs some work to make it more newbie friendly...
---------
For me, what I've found best in my approach towards picking up
wxPython was to have four sources of information available:
1. wxPython demo (in the 'demo' directory of wxPython)
2. wxWindows help documentation (in the 'docs' directory of wxPython)
3. wxPython installed modules (in the main and lib wxPython directory)
4. wxWindows/wxPython source. (retrieve from the wxWindows or wxPython
site)
1. The demo is by far the easiest to start with since it's chock full
of code that you can interactively see run and then "borrow" the
actual code, either from the demo program's listing pane or from the
filesystem. You can go quite a long way just depending on the demo -
you may not get every tiny little thing the way you want but it should
be really easy to get a functioning application. Once you start
getting down the nitty gritty and having other questions, I find the
other sources to be the most useful in the order listed.
2. Although there are times when it can be ambiguous with respect to
wxPython (not quite everything that needs a wxPython note has one) or
even slightly out of whack with wxWindows itself, the wxWindows
documentation is really quite good, and it also includes some general
overviews. The information is for the most part, directly
translatable to wxPython.
3. When in doubt about how wxPython wrapped something from wxWindows
(and it's not used in a demo the way I want to use it), I start with
the wxPython .py modules - looking through them can verify which
methods are wrapped and available (and I found particularly helpful
with the new grid class which isn't documented elsewhere yet).
However, at some point this doesn't help fully since the wrapper
doesn't show you precise parameters for all methods, just a generic
SWIG interface. So then you go to...
4. The source is the final arbiter. :-) First, I'll look at the SWIG
interface files for wxPython which will let me know precisely what is
wrapped and how. If something there is still unclear, I'll revert
back to the wxWindows source and see what actually happens for a class
or method (although this requires understanding C++ to follow fully).
And within the wxWindows source, there are also other direct wxWindows
samples that (again, requiring C++ knowledge) can provide some further
samples of operating code.
The vast majority of learning I did with (1) and (2) - I've only had
to delve into (3) and (4) occasionally, but it was really nice to have
them around when I needed to.