Python and VTK and TK

David Gobbi dgobbi at
Thu Apr 20 19:49:31 EDT 2000

Scott Harris <scottrharris at> wrote:
> Has anyone gotten VTK to work with the TkRenderWidget?
> I've got a simple code that draws two buttons and a vtkTkRenderWidget in
> a frame.
> It works under win98, but crashes my XServer on Linux.

Hi Scott,

I've used the vtkTkRenderWidget with XFree-3.9.18 and there weren't
any problems -- not with hardware acceleration though.  In order to
make it work, you have to either copy it into /usr/lib or setenv 
the VTK_TK_WIDGET_PATH environment variable to <wherever>/vtk/python.
Oh, and you must also configure VTK using --with-shared.

I have had problems with vtk and accelerated glx under XFree-3.3.*,
though... the glx doesn't define glIsTexture() and calls to this 
function will crash the server.  This happens whenever VTK tries
to release a texture.  The 'fix' is simple but inelegant -- comment
out the glIsTexture() line in vtkOpenGLTexture.cxx. 

If you get wxPython's widget working under Linux I'd like to hear
about it.  We're doing all our stuff in Tk, but we're certainly
not satisfied with Tk as a GUI toolkit.  We do 95% of our interaction
through picking and dragging, though, so the toolkit we use doesn't
matter all that much.

 - David

  David Gobbi, MSc                    dgobbi at
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

> I'm using RH6.1 with XFree864.0 and a Voodoo3 card (so I have
> accelerated GL rendering)
> I've got VTK 3.1

> Anyhow, I'm going to try wxPython and it's VTK widget in the next few
> days.

> If you had to start a new moderately sized project would you use
> wxPython or Tk?

> -Scott Harris
> scottrharris at

More information about the Python-list mailing list