[vtkusers] Print method output from Tcl script -- PROPOSAL

Volpe, Christopher R (CRD) volpecr at crd.ge.com
Fri Feb 9 12:35:12 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 
|> 

Ok, except for the massive recompilation, does anyone have any serious objections to this:

void vtkObject::PrintWindow()
{
  char *vtkmsgbuff; 
  ostrstream vtkmsg;
  this->Print(vtkmsg);
  vtkmsgbuff = vtkmsg.str(); 
  vtkOutputWindowDisplayText(vtkmsgbuff);
  vtkmsg.rdbuf()->freeze(0);
}




More information about the vtkusers mailing list