[vtk-developers] Cocoa render window and mouse move events
David Thompson
dcthomp at sandia.gov
Wed Aug 25 11:40:20 EDT 2010
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.
David
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?
>
> Thanks,
>
> Marcus
> --
> Marcus D. Hanwell, Ph.D.
> R&D Engineer, Kitware Inc.
> (518) 881-4937
> <ATT00002..txt>
More information about the vtk-developers
mailing list