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

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Aug 25 15:14:37 EDT 2010


Hi David,

On Wednesday 25 August 2010 12:26:26 David Thompson wrote:
> Hi Marcus,
> 
> You might try changing
> 
>    ADD_EXECUTABLE(${KIT}CxxTests ${Tests} )
> 
> to
> 
>    ADD_EXECUTABLE(${KIT}CxxTests MACOSX_BUNDLE ${Tests} )

I had not considered this difference.
> 
> in Views/Testing/Cxx/CMakeLists.txt and rebuild. You'll get a ".app"
> executable and when you run
> 
>    ./bin/ViewsCxxTests.app/Contents/MacOS/ViewsCxxTests
> TestGraphLayoutView -I
> 
> instead of
> 
>    ./bin/ViewsCxxTests TestGraphLayoutView -I
> 
> you'll see different behavior. (I still had to click the mouse button
> once before hover started working, but after the first click hover
> boxes did start appearing.)
> 
> Without being marked as a bundle, Cocoa applications don't get full
> access to keyboard and mouse events from the window manager. This was
> discussed on the list a while back but the platform-dependent naming
> of the test executables made folks wary of adding MACOSX_BUNDLE to the
> test executables, especially since -- as you pointed out -- none of
> the tests listen for actual mouse events.
> 
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).

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. I 
wonder if Python somehow sidesteps this, hence Eric's observation.

I will try this out to satisfy my own curiosity. I will attempt to at least 
document this odd behavior somewhere appropriate.

Thanks,

Marcus



More information about the vtk-developers mailing list