[vtk-developers] Cocoa render window and mouse move events

Sean McBride sean at rogue-research.com
Mon Aug 30 16:50:16 EDT 2010


On Wed, 25 Aug 2010 11:21:40 -0400, Marcus D. Hanwell said:

>mouse button pressed down. I was hoping that some of the Mac experts on the
>list might have some ideas as to what might be missing, it would seem that
>the Qt windows are able to receive these mouse move events, and so our Cocoa
>render window or interaction translation code could be patched.

Marcus,

Sorry I missed this discussion, I was on vacation last week.

When VTK itself creates the NSWindow (see
vtkCocoaRenderWindow::CreateAWindow()) support for 'mouse move' events
is turned on ("setAcceptsMouseMovedEvents:YES").  If VTK does not create
the NSWindow, it does not turn them on nor off.

>Thanks for the explanation - I think I missed that thread but I do remember 
>some of these oddities about being a MACOSX_BUNDLE or not. If all you
need to 
>do it click on the Window once to receive those events it is not too out of 
>the ordinary (giving the window focus).

So did making it a bundle result in you getting the mouse move events?

>It is a shame there is this odd differing behavior. I can see why we
>might not 
>want to make the tests bundles, but it does present a very odd behavior.

This issue is here BTW:
<http://public.kitware.com/Bug/view.php?id=2025>

For better or worse, Apple's position is that creating a GUI (ex:
NSWindow) from a command line application is 'unsupported' (though in
practice, it mostly works).

>I wonder if Python somehow sidesteps this, hence Eric's observation.

Could it be that in the Python case it's not VTK that creates the NSWindow?

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list