[vtkusers] Re: VTK + GTK

Dave Reed dreed at capital.edu
Fri Mar 11 08:46:06 EST 2005


> Date: Thu, 10 Mar 2005 18:25:59 -0600
> From: =?ISO-8859-1?Q?Juan_Jos=E9_Aja_Fern=E1ndez?= <juan.aja at gmail.com>
> 
> Hi, I was wondering if anybody has experience using vtk and gtk for the gui.
> 
> I added the line:
> INCLUDE (${CMAKE_ROOT}/Modules/FindGTK.cmake)
> to my CMakeLists.txt, but when I try compiling it tells me:
> "gtk/gtk.h: No such file or directory", but I can compile the snippet
> made in gtk outside my vtk program.
> 
> In short, what do I need to pass to cmake in order to link the
> required gtk libraries?

There shouldn't be any need to link the Gtk libraries when building
VTK. When you compile your program that uses Gtk and VTK you will
obviously need to link with both. I think some examples were posted
quite a while ago so you might try searching the list archives. The
only trick is to get the OpenGL window to use a widget inside GTK
instead of it's own window - I think you need a special widget based
on the drawing area widget for OpenGL. Try googling for gtkglarea
(although I think it's been replaced by a newer version with a
different name).

I have some pygtk examples that use VTK, if you're using Python, but I
don't think I have any C++ examples. It's been quite a while since
I've done it so I can't give you more explicit instructions. Sorry I
can't be of more help, but this might point you in the correct
direction.

Dave







More information about the vtkusers mailing list