[wxPython-users] device context : manage object

Christopher Barker Chris.Barker at noaa.gov
Thu Oct 26 09:37:05 PDT 2006


TheMoon Seeker wrote:
> I'm searching methods that let us manage object in a device context. For 
> example, Tkinter let us find (find_closest) object in a canvas. Is there 
> similar methods for wxPython?

wxWidgets does not provide anything like the TK Canvas.

However, there are tow options for wxPython:

OGL and FloatCanvas.

OGL is designed to support "boxes and arrows" type diagrams, but looks 
to be flexible enough to support other uses.

FloatCanvas is designed to support interactive graphics in arbitrary 
floating point coordinates, including built-in zooming and panning. It's in:

wx.lib.floatcanvas, and there is a demo included with the wxPython demo 
(required numpy). There is a newer version available from me, you can 
send questions to me and/or the floatcanvas mailing list:

http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

In regards to your specific question -- FloatCanvas has no 
"find_closest", but does have hit-testing, so you can bind an function 
call to a mouse event on an objects, and, to some degree, define how 
close you need to be to an object to hit it.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (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