I've attached my first real effort using wxPython. I had stalled
until Robin and Noel's book came out, and got through about half the
book before giving in to my desire to start coding. I've written some
python in the past, but mostly just ugly scripts for doing various
permutations of search and replace. So most of this code will look a
lot like the examples in the book, plus I also picked up a couple
tricks from the first chapter of the Python Cookbook. Beyond that, I
have no idea what the "right way" to do a lot of these things are, and
am hoping some people here might be willing to wade through this code
and give me some pointers.
Overall, I'm pretty happy with how it's going (I'm really loving both
Python and wxPython). I'm mostly looking for issues like those
already mentioned: don't pass in pos to PopupMenu, use ListCtrl with
Report/NoHeader flags instead of ListBox, etc.
Please don't take this as a request for free QA support. I think I've
got a pretty good handle on that already, and imagine that would come
across as rather rude.
I guess some context for this code might help. I wanted to make a
simple editor for declaring C++ classes. This will be used to export
class definition headers and also extra data that can be loaded at
runtime to build up meta data for those classes. That data will then
be used to implement features such as automatic serialization,
downcasting, etc.
I've got a fair amount of experience writing code (mostly C++), just
not in Python or wxPython. Any bits of shared wisdom will be most
appreciated.
P.S. Andrea, the HitTest code you posted worked great, although I'm
going to try switching over to a ListCtrl at Robin's suggestion and
see how that works. First, though, I wanted to write up a bunch of
unittests so I don't break too much in the conversion - and as a good
excuse to learn how unittesting works in a gui environment. Some day
I will learn to write my unit tests first.
MetaEd.py (26.7 KB)
CircularReference.py (291 Bytes)
···
On 5/11/06, Andrea Gavana <andrea.gavana@gmail.com> wrote:
I don't think that a newbie that really wants to learn will ever be
considered as spammer if he/she posts some code. I think here there
are a lot of powerful coders that are glad to help newbies as long as
they demonstrate that they are putting a real effort in coding