[vtkusers] vtkTkRenderWidget in interpreter created within C++

Oladele Martins oladele_martins at hotmail.com
Tue Nov 14 05:53:34 EST 2000


Dear vtkusers.

I have encountered a problem trying to use vtkTkRenderWidget which I have 
not been able to solve on my own. Reading through the entire mailing list on 
the subject did not turn up any results either so maybe the solution is 
obvious and I'm just plain dumb. Anyway I hope you can help me.


What I am trying to do:

I have an application written in C++ for which I now want to add a GUI using 
VTK and Tcl/Tk. I have created an interpreter using the usual Tk_Main(...) 
procedure and want to call a Tcl/Tk script via Tcl_Evalfile() which will 
create the GUI. I want to use vtkTkRenderWidget within this script. I have 
built vtktcl and have tried to introduce VTK to the interpreter I created 
within the C++ code by inserting the line

catch { load /my_path/vtk31/tcl/vtktcl }

at the beginning of my script. The interpreter now seems to be able to use 
the usual aspects of VTK ( actors, renderers, spheresource, etc ) but 
returns an error as soon as I use vtkTkRenderWidget in the script. My 
question is: How can I use vtkTkRenderWidget in my interpreter? The vtk 
executable obtained when building vtk is obviously able to do
this so I conclude that there is a solution to my problem.


I have created the actors, renderwindow, renderer, ... in the C++ code and 
intend to display them in the afore mentioned widget. I learned from the 
mailing list that it is possible to access data created within the 
interpreter using vtkTclGetPointerFromObject()
located in /common/vtkTclUtil.cxx. and hope to exploit this by assigning a 
renderWindow to the widget this way. Will this work?

Any comments or hints on my two questions are appreciated beyond measure. If 
any aspect of what I intend to do is impossible please let me know.

Thanks in advance
Oladele Martins.


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.





More information about the vtkusers mailing list