Re: [ROOT] "piping" objects into Rint?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Sep 07 2002 - 22:00:22 MEST


Hi Wolgang,

Your question is not clear to me. If you execute the short example below,
you should be able to play with the object c1;

//program walt.cxx
#include "TRint.h"
#include "TCanvas.h"
#include "TLine.h"

int main(int argc, char **argv) {
   TRint theApp("Rint", &argc, argv);
   TCanvas *c1 = new TCanvas();
   TLine *l = new TLine(.1,.2,.8,.7);
   l->Draw();
   
   theApp.Run();
   return 0;
}

g++ -o walt walt.cxx `root-config --cflags --glibs`
walt
root [0] c1.ls()
Canvas Name=c1 Title=c1 Option=
 TCanvas fXlowNDC=0 fYlowNDC=0 fWNDC=1 fHNDC=1 Name= c1 Title= c1 Option=
  TLine  X1=0.100000 Y1=0.200000 X2=0.800000 Y2=0.700000

Rene Brun

On Mon, 26 Aug 2002, Wolfgang Waltenberger wrote:

> Dear Roottalk, 
> 
> consider the following code in an application:
> 
> TRint r("Test", NULL,  NULL );
> TCanvas *c1 = new TCanvas();
> r.Run();
> 
> How can I "pull" my TCanvas object "into" the runtime environment?  All
> my efforts did not work; TRint seems to "see" an object called c1, but
> it's always a null pointer - no matter if TCanvas is used with "static"
> or "new" or anything . Although, it is a pointer pointing to a TCanvas
> object, mind you. So is there a simple way to preserve objects.  I want
> instantiation to occur in the mother application, then mess around with
> them in the TRint "daughter", like a very fancy debugger ...
> Is there a way?
> 
> Ciao, Wolfgang.
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:08 MET