[vtkusers] Print method output from Tcl script

Berk Geveci berk.geveci at kitware.com
Thu Feb 8 17:14:48 EST 2001


	Chris,

	It  looks like the answer is no. Here is the part of vtkObjectTcl.cxx
	that handles Print:

  if ((!strcmp("Print",argv[1]))&&(argc == 2))
    {
    ostrstream buf;
    op->Print(buf);
    buf.put('\0');
    Tcl_SetResult(interp,buf.str(),TCL_VOLATILE);
    delete buf.str();
    return TCL_OK;
    }

	The output goes back to the tcl interpreter and I don't think it
        can be re-directed to the error window. But there has to
	be a way of re-directing tcl output to a tk window you create.
	If you really want the output to appear on the same window as the
	error messages, you need to change the way the wrapper handles Print 
	(look, for example, at vtkErrorMacro in vtkSetGet.h) or somehow get
	the handle of the tk widget created by vtk and re-direct the output
	there.

	Berk




More information about the vtkusers mailing list