[vtkusers] AddObserver in python?

David Gobbi dgobbi at imaging.robarts.ca
Mon Sep 22 22:12:48 EDT 2003


Hi Tim,

I just patched the AddObserver in CVS so that it will take the
optional priority argument.  The AddObserver method is one of the
few that is not wrapped automatically, and the 'Python' version
of AddObserver wasn't up to date with the C++ version.

For your second question, take a look at
VTK/Wrapping/Python/vtk/tk/vtkTkRenderWindowInteractor.py
It catches Tk events and then passes them through to the interactor,
similar classes are available for wxWindows and PyQt.  Doing
the catch-or-pass-through trick is probably easier if you use
a GUI toolkit than if you just use the raw RenderWindowInteractor.

 - David

--
  David Gobbi, PhD                dgobbi at imaging.robarts.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Mon, 22 Sep 2003, Tim Newsham wrote:

>
> Why does the vtkObject method AddObserver only take two arguments
> in python (the optional priority cannot be provided)?  Is this an
> oversight?  How does one add an observer to the be called before
> any other callers?
>
> On a related note -- I'm trying to observe some events and prevent
> others from acting on them.  I have a RenderWindowInteractor, and I
> want to occasionally catch mouse clicks and act on them and override
> the default behavior or the renderer.  At other times I would like
> the click to flow through to the interactor so that navigation can
> be performed.  Is this possible from python?
>
> Tim N.
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list