Commit e8295dc7 authored by David Gobbi's avatar David Gobbi Committed by David Partyka
Browse files

BUG 09223: Fix pointer mangling in vtkTkPhotoImage.py

parent 563935c6
......@@ -170,8 +170,13 @@ extern "C" {
void *ptr;
char typeCheck[128];
sscanf ( argv[1], "_%lx_%s", (long *)&ptr, typeCheck);
if ( strcmp ( "vtkImageData", typeCheck ) != 0
&& strcmp ( "vtkStructuredPoints", typeCheck ) != 0 )
// Various historical pointer manglings
if ( strcmp ( "vtkImageData", typeCheck ) != 0 &&
strcmp ( "vtkImageData_p", typeCheck ) != 0 &&
strcmp ( "p_vtkImageData", typeCheck ) != 0 &&
strcmp ( "vtkStructuredPoints", typeCheck ) != 0 &&
strcmp ( "vtkStructuredPoints_p", typeCheck ) != 0 &&
strcmp ( "p_vtkStructuredPoints", typeCheck ) != 0 )
{
// bad type
ptr = NULL;
......
......@@ -18,7 +18,8 @@ class vtkTkPhotoImage ( Tkinter.PhotoImage ):
# Caller the superclass
Tkinter.PhotoImage.__init__ ( self, kw )
vtkLoadPythonTkWidgets ( self.tk )
def PutImageSlice ( self, image, z, orientation='transverse', window=256, level=128 ):
t = image.__this__
s = 'vtkImageDataToTkPhoto %s %s %d %s %d %d' % ( t[:-2], self.name, z, orientation, window, level )
t = str ( image.__this__ )
s = 'vtkImageDataToTkPhoto %s %s %d %s %d %d' % ( t, self.name, z, orientation, window, level )
self.tk.eval ( s )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment