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

anast.jm at pg.com anast.jm at pg.com
Fri Feb 9 15:38:36 EST 2001


I tried this in a script where no output window opened normally and it seems to
work okay

vtkOutputWindow ow
     ow DisplayText [ow Print]

...john anast

 Internet Mail Message                                          
 Received from host:      public.kitware.com                    

From: "Volpe, Christopher R (CRD)" <volpecr at crd.ge.com>@public.kitware.com on
02/09/2001 12:35 PM
            "Volpe, Christopher R (CRD)"           To:   "'Berk Geveci'"                      
 <volpecr at crd.ge.com>@public.kitware.com        <berk.geveci at kitware.com>,                    
                                                vtkusers at public.kitware.com                   
                                                   Cc:    (bcc: John Anast-JM/PGI)            
                                Sent by:   Subject:      RE: [vtkusers] Print method output   
       vtkusers-admin at public.kitware.com        from Tcl script -- PROPOSAL                   
                     02/09/2001 12:35 PM                                                      

|>   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;
  vtkmsgbuff = vtkmsg.str();

This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
Follow this link to subscribe/unsubscribe:

More information about the vtkusers mailing list