[vtk-developers] cocoa on macosx
Jeff Lee
jeff at cdnorthamerica.com
Wed Dec 31 07:35:59 EST 2003
Hi Mathieu,
Looks like that will fail for cocoa because vtkCocoaRenderWindow will
try to cast your handle to a vtkCocoaWindow and will bomb there. I am
thinking that vtkCocoaRenderWindow should take an NSWindow or NSView and
internally make a vtkCocoaWindow with the NSWindow as an ivar. I think
I'm going to have to get the mac cocoa book and start reading... Where
is Yves when you need him?
Thanks,
-Jeff
mathieu.malaterre at kitware.com wrote:
>>Hi All,
>>Does anyone know how to create a vtkCocoaWindow to pass into
>>vtkCocoaRenderWindow->SetWindowId(...)? I am given an NSView from java
>>and want to map the render window to that NSView. Basically it looks
>>like I need to create a vtkCocoaWindow given a pre-existing NSWindow,
>>but objectivec looks like greek to me. After getting a vtkCocoaWindow
>>with the right handle, it looks like I should just be able to pass that
>>into vtkCocoaRenderWindow->SetWindowId(...) and have it all work, right?
>>
>>
>
>
>Hi Jeff,
>
> I never tried it myself because I didn't had a mac at that time, but i did something like (*). For a more complete answer please go to :
> http://creatis-www.insa-lyon.fr/~malaterre/wxVTK/
>
>And dowload wxVTK.tgz.
>
>HTH
>Mathieu
>
>(*)
>#ifdef __WXMAC__
>#ifdef VTK_USE_COCOA
> wxTopLevelWindow* toplevel = dynamic_cast<wxTopLevelWindow*>(
> wxGetTopLevelParent( this ) ) ;
> if (toplevel != NULL )
> {
> handle_tmp = (long)toplevel->GetNSWindow();
> }
>#endif //VTK_USE_COCOA
>#ifdef VTK_USE_CARBON
> handle_tmp = (long)this->MacGetRootWindow();
>#endif //VTK_USE_CARBON
>#endif //__WXMAC__
>
>
>
>_______________________________________________
>vtk-developers mailing list
>vtk-developers at vtk.org
>http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>
>
--
Jeff Lee
Senior Software Engineer
Computational Dynamics North America Ltd
21 Lafayette Street, Suite 230
Lebanon NH 03766 USA
fax: 603 643 9994
phone: 603 643 9993 x109
http://www.cd-adapco.com
More information about the vtk-developers
mailing list