[vtkusers] mouse events

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Wed Sep 18 02:29:13 EDT 2002


>>>>> "GW" == Galen Wilkerson <galen at sp1.compbio.washington.edu> writes:

    GW> I'm trying to understand how to capture mouse events in VTK
    GW> with Python.

    GW> It looks like I have to write my own Start() method for
    GW> vtkRenderWindowInteractor , but I'm guessing.

What toolkit are you using?  vtkRenderWindowInteractors for Tkinter,
pyGTK, wxPython and Qt are available.  This is all in CVS but I think
it was committed about 5-6 months back.

To capture the mouse just add a new observer for the right event and
do what you need.

    GW> If there are any simple examples of this, I'd be grateful.
    GW> (For instance, how to select an object that is displayed on
    GW> the screen by clicking on it, or dragging over it.)

You are looking for a Picker.  Try one of the vtkPickers.

cheers,
prabhu



More information about the vtkusers mailing list