[vtkusers] Wrapping additional C++ classes using Tcl

Peter Welsh peter.welsh at vips.co.uk
Fri Mar 4 08:22:33 EST 2005


I am having trouble calling commands from my new C++ class.

I have created a file called vtkNewClass.cxx

I then proceeded by running the vtkWrapTcl script to produce
vtkNewClassTcl.cxx.

I then ran vtkWrapTclInit using the command:

%vtkWrapTclInit New vtkNewClassTcl.h New.cxx

to produce the file New.cxx.

I then compiled the files to create a new library and created a new
executable to include the new library.

When I use the Tcl to access the new class I manage to construct it ok using
the Tcl command:

vtkNewClassTcl foobar

but when I try to access a command within the new class using the TCL
command:

foobar SetFontSize

I get an error message:

Error in startup script: Object named: foobar , could not find requested
method: SetFontSize
or the method was called with incorrect arguments.

The command exists within the vtkNewClassTcl.cxx file and within the
vtkNewClass.cxx file but cannot seemed to be accessed.

Does anyone have any idea what I am doing wrong, it's seems as though I need
to set up a link to access the commands within the new class, but I thought
the Wrapping scripts would do this automatically.

thanks in advance.

Peter










More information about the vtkusers mailing list