[wxPython-users] Creating Custom wxPython Widget

Christopher Barker Chris.Barker at noaa.gov
Mon Dec 11 12:06:46 PST 2006


Chris Mellon wrote:

> This might be an excellent place to experiment with weave (part of
> scipy, from the same source as numpy),

hmmm -- I've never thought to use weave to call wx methods -- how the 
heck would you get a pointer to the DC?

 > I've never used it, but it should be possible to loop over
> the internal C++ numarray representation, calling DrawLine() as
> needed, all in C code.

Well, there is already DrawXXXList, that does that. In this case, what 
I'm looking for a is a way to directly pass the pointer to the numpy 
data block to the constructor for a wxPointList (or to an overloaded 
Draw* method that takes a pointer to a C array.

> That gets Python totally out of the way and
> should make for a very large speedup.

Well, maybe. I did some work with DrawXXXList, and the speed-up is only 
significant for simple objects: Points, Lines. For more complex stuff , 
including, to my surprise, bitmaps, the drawing time overwhelms the 
Python-C++ data translation anyway.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list