X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreawxVTKRenderWindowInteractor.cxx;h=ab565eed6bf64ca4b4435615db9b2d537585dff8;hb=cec56a30635f62b8363a226847749d1dcd54138e;hp=62cd9da53b914773d592cfae26a6af5abf20e1c5;hpb=1fb1974b5578149b436553cf5f620372a8a6a69e;p=crea.git diff --git a/src/creawxVTKRenderWindowInteractor.cxx b/src/creawxVTKRenderWindowInteractor.cxx index 62cd9da..ab565ee 100644 --- a/src/creawxVTKRenderWindowInteractor.cxx +++ b/src/creawxVTKRenderWindowInteractor.cxx @@ -43,6 +43,8 @@ =========================================================================*/ + + #include #include "creawxVTKRenderWindowInteractor.h" @@ -61,7 +63,8 @@ // AKT: wxOSX 2.9.x defines __WXOSX_COCOA__ rather than __WXCOCOA__ #ifdef __WXOSX_COCOA__ -#define __WXCOCOA__ + #import + #define __WXCOCOA__ #endif #if defined(__WXMAC__) && wxCHECK_VERSION(2,9,0) @@ -100,7 +103,7 @@ wxWindow* wxGetTopLevelParent(wxWindow *win) // To access objc calls on cocoa #ifdef __WXCOCOA__ #ifdef VTK_USE_COCOA -#import +//EED #import // This trick is no longer need in VTK CVS, should get rid of that: #define id Id #else @@ -506,8 +509,16 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) { Handle = GetHandleHack(); - +#ifdef __WXCOCOA__ + vtkCocoaRenderWindow *rwin = vtkCocoaRenderWindow::SafeDownCast(RenderWindow); + NSView *nvsview = (NSView* )Handle; + NSWindow *nswindow = nvsview.window; + rwin->SetRootWindow( nswindow ); + rwin->SetWindowId( reinterpret_cast(nvsview) ); +#else RenderWindow->SetWindowId(reinterpret_cast(Handle)); +#endif + // Cocoa @@ -928,6 +939,7 @@ void wxVTKRenderWindowInteractor::Render() RenderWindow->Render(); } #endif + } } //---------------------------------------------------------------------------