[vtk-developers] VTK-carbon on OS X 10.6

Sean McBride sean at rogue-research.com
Tue Sep 22 18:17:15 EDT 2009


On 9/22/09 4:02 PM, David Gobbi said:

>Line 1152 in vtkTkRenderWidget.cxx and line 822 in
>vtkTkImageViewerWidget.cxx, both needed typecasts as follows:
>
>parentWin = GetWindowFromPort((OpaqueGrafPtr*)TkMacOSXGetDrawablePort(
>                                    Tk_WindowId(
>                                    (OpaqueGrafPtr*)winPtr->parentPtr)));
>
>This code is only compiled when VTK_WRAP_TCL and VTK_USE_CARBON are
>set, and AFAIK the type casts are only needed under OS X 10.6.

Using a tool like Araxis Merge to diff the entire 8.4 folder against the
8.5 folder is instructive.  TkMacOSXGetDrawablePort() was indeed changed
from returning a GWorldPtr to returning a void*.  A GWorld is a
QuickDraw (Carbon) data type which has been deprecated for years. 
Presumably when/if Tk switches to Cocoa it will return some Cocoa object
instead.

>Because on the mac, Tk is built with Carbon.  There is an experimental
>version of Tk that uses Cocoa that I'm going to try, but of course the
>OS X Tk code in VTK is Carbon specific, so VTK won't be able to use it
>without some serious modifications.

So even 10.6's Tk 8.5 is still using Carbon?

Good luck!  Looks like you are breaking new ground. :)

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list