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

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Aug 25 11:49:52 EDT 2010


Hi David,

On Wed, Aug 25, 2010 at 11:40 AM, David Thompson <dcthomp at sandia.gov> wrote:

> Hi Marcus,
>
> I think what you're looking for is NSTrackingArea:
>
>
> http://developer.apple.com/mac/library/documentation/cocoa/conceptual/EventOverview/TrackingAreaObjects/TrackingAreaObjects.html#//apple_ref/doc/uid/10000060i-CH8-SW1
>
> Note that it was introduced in MacOS X 10.5, but in the "Compatability
> Issues" section of the link above is a description of older methods used to
> track mouse motion. You can also use setAcceptsMouseMovedEvents: method of
> NSWindow but see
>
>
> http://developer.apple.com/mac/library/documentation/cocoa/conceptual/EventOverview/HandlingMouseEvents/HandlingMouseEvents.html
>
> for the dire warning about flooding the event dispatch mechanism.
>
> Line 579 in Rendering/vtkCocoaRenderWindow.mm seems to be setting that, but
for some reason I still don't seem to be getting the mouse move. This is me
moving the mouse around very slowly too, and not being very familiar with
Cocoa or Objective C++.

Thanks for the pointers, I thought that like was attempting to say the
Window would take all mouse moved events. My testing has been on Max OS X
Snow Leopard. I will read around a little more.

Thanks,

Marcus

>
> On Aug 25, 2010, at 8:21 , Marcus D. Hanwell wrote:
>
>  Hi,
>>
>> I have been looking into a bug found during some of the work we have been
>> doing in the charts, but the bug also presents itself in the graph layout
>> view,
>>
>> ./bin/ViewsCxxTests TestGraphLayoutView -I
>>
>> The vertices should have hover text that shows up when the mouse moves
>> over the vertices. On Linux and Windows the text shows up, whereas on Mac OS
>> X with the Cocoa render window it does now. The same is true of the charts,
>> which have tooltips when the mouse moves over a data point. This works on
>> Linux and Windows, but for Cocoa it does not.
>>
>> If you use the same charts in a Qt widget, e.g. a QVTKWidget in ParaView,
>> the mouse move events are propagated. It seems when the mouse button is
>> pressed down the mouse move events are propagated, but not if there is no
>> 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.
>>
>> Another interesting question, is there any way we can test this? All of
>> the mouse interaction tests inject the events into VTK, and do not actually
>> move the mouse. Is there a cross platform tool we could use to test some of
>> the interaction code, and would it be worth adding to VTK?
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100825/c88b7438/attachment.html>


More information about the vtk-developers mailing list