[vtkusers] embedded rendering window, passing a tk-render window to C++

Marc Niethammer marcn at ece.gatech.edu
Mon Dec 3 11:36:12 EST 2001


Hi Kevin,

I used the vtkTkRenderWidget class in Tcl/Tk to obtain an embedded
rendering window. However, how do I pass the render Window to my C++
function (since this should be a pointer in C++). I.e. how do I tell
Tcl/Tk to pass a pointer to a c function like the following?

int vtkCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj
*CONST objv[]);

And is there any way to get rid of the error message: 

"Generic Warning: In vtkTkRenderWidget.cxx, line 313
A TkRenderWidget is being destroyed before it associated vtkRenderWindow
is destroyed. This is very bad and usually due to the order in which
objects are being destroyed. Always destroy the vtkRenderWindow before
destroying the user interface components."

when ending the tcl/tk script with exit?

Thanks for your help.

-- Marc

>-----Original Message-----
>Is it possible to direct the output of the vtk renderer to a tk frame?
>I.e. to have a window that includes the rendering window and a couple
>of buttons or other gui elements? (i am trying to use tcl/tk for the
>user interface and interface it with c++ vtk code).
>---------------------------

>You can use the vtkTkRenderWidget class in Tcl/Tk to build a GUI with an
>embedded render window.  If you want to tie that to C++ VTK code, you
>have some choices.  You can either build some Tcl commands to allow
>access to your C++ code from Tcl (see Tcl guides for details on that), or
> you can build a single command which takes the render window created by
> the vtkTkRenderWidget and passes it down to your C++ code.  If you're
> unclear on how to do any of that, just drop me a note and I can expand
> on it.
>
> Kevin.





More information about the vtkusers mailing list