[vtkusers] MAC OS VTK WXWidgets

Jaonary Rabarisoa jaonary at free.fr
Thu Feb 16 11:03:22 EST 2006


Hi all,
I'm trying to port an application based on wxWidgets and VTK. This  
application was initially developped on a linux box (wxGTK) and now  
runs well on a windows box too. I'd like to port it on mac os but  
using wxMAC instead of wxGTK.
The problem that I have is that I probably need to pass a pointer to  
an HIViewRef to the object vtkCarbonRenderWindow. This HIViewRef  
pointer is obtained from the current wxGLcanvas, but I can't figure  
out how to do this. Below, you can find the equivenlent code for  
wxGTK and wxMSW. Note that with wxMSW we use a wxPanel instead of  
wxGLcanvas, so the pointer "this" is a wxPanel* in this case.

rwin is a pointer to a vtk[WIN32,XOpenGL,Carbon]RenderWindow :

#ifdef __WXMSW__
		this->rwin->SetWindowId((HWND)this->GetHandle() );
#elif __WXGTK__
		assert(GTK_WIDGET_MAPPED(m_wxwindow));
#if (GTK_MAJOR_VERSION > 1)
		GdkWindow* bwin = (GdkWindow *)GTK_PIZZA(m_wxwindow)->bin_window;
		this->rwin->SetDisplayId(GDK_WINDOW_XDISPLAY(bwin));
		this->rwin->SetWindowId(GDK_WINDOW_XWINDOW(bwin));
#else
		GdkWindowPrivate* bwin = (GdkWindowPrivate *)GTK_PIZZA(m_wxwindow)- 
 >bin_window;
		this->rwin->SetDisplayId( bwin->xdisplay );
		this->rwin->SetWindowId( bwin->xwindow );
#endif

If I use carbon with VTK, I need to pass an HIViewRef to the function  
SetWindowId. So how can I get this from my current wxGLcanvas ?

Thank you for your help,

Jaonary




More information about the vtkusers mailing list