[vtkusers] How to manage events between vtkRenderWindowInteractor and Observers?
kent williams
nkwmailinglists at gmail.com
Fri Jul 10 14:42:21 EDT 2009
OK, answered my own question. I was calling AddObserver without
specifying a priority meaning that my observer got notified last about
keyboard events. Setting priority to a non-zero number means my
observer will get key events first, which will keep the view from
going into zoom mode...
On Fri, Jul 10, 2009 at 11:47 AM, kent
williams<nkwmailinglists at gmail.com> wrote:
> I'll try to be concise and clear but this is a bit convoluted to
> describe. I'm open to suggestions on better ways to do this.
>
> GOAL: add a context menu to a vtkRenderWindow, that pops up on Control
> + Right Mouse Click
>
> METHOD USED: Add an observer on the vtkRenderWindowInteractor instance.
>
> PROBLEM: The right-mouse-click event gets processed by both by my
> Observer and other Observers in the view.
>
> SYMPTOM: After menu pops up, once menu is dismissed, the view is left
> in 'zooming' mode -- i.e. moving the mouse zooms the window until I
> click the mouse in the window again.
>
> I've partially fixed this problem. In my vtkCommand subclass, I call
> vtkCommand::SetAbortFlag(true). This pops up the menu, and if I select
> one of the menu items, the render window doesn't go into zoom mode.
>
> But if I dismiss the menu without picking a menu item, either by
> hitting Escape, or clicking anywhere outside the menu, the
> RenderWindow is left in the 'zooming state.
>
More information about the vtkusers
mailing list