[vtkusers] VTK event handling
payman labbaf
payman_vtk at yahoo.co.uk
Wed Sep 1 09:38:23 EDT 2004
How can I catch VTK mouse events in my parent window which is in C# or managed C++? At the moment vtk catches all the event but I want my parent window to catch the events. I've tried disabling the event handling in the interactor style; although the events were not fired by VTK anymore but still I can't receive events in my parent window.
I've been told a few ways to sort this out but I don't know which way is the best.
Here are some candidate solutions
1- customising wnd_proc function and on receiving the favourite message take necessary action such as notifying the parent window that message was received.
2- subclassing InteractorStyle.
3- passing a callback function pointer to vtkObserver.
Because I'm writing my application in managed code and using an unmanaged library, all the above solutions will be difficult to implement. They need converting managed object to unmanaged and in one case it involves converting a delegate(.Net type) to function pointer (unmanaged c++ type) and vice versa. (oou la la)
I was wondring if anyone had faced this problem before or have any opinion to sort this out. I still think there is an easier solution like passing the parent window's handler (hwnd) to vtk so any events can be caught in parent window.
Any help is appreciated in advance.
---------------------------------
ALL-NEW Yahoo! Messenger - all new features - even more fun!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040901/e865ea7c/attachment.htm>
More information about the vtkusers
mailing list