Re: Dynamic Canvas "how to"

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sat, 17 Oct 2009 11:36:16 +0200


What is your problem? Could you clarify what you mean by: "the execution of the code seems does not proceed" ?

Note that it is in general a bad idea to implement your own main program. Instead use root.exe and call
a script (via the interpreter or ACLIC), ie

   root > .x vito.C
 or
   root > .x vito.C+

where vito.C is a simple script like

#include "TROOT.h"
#include "TApplication.h"
#include "TCanvas.h"

void vito() {
// FileReader FileIn("rates.dat");

 gROOT->SetStyle("Plain");

 TCanvas canvOne("canvOne", "One");
 gPad->Range(-2000,

             -2000,
             2000,
             2000);

 TCanvas cavTwo("canvTwo", "Two");
 gPad->Range(-2000,

             -2000,
             2000,
             2000);

}

Rene Brun

Vito Palladino wrote:
> Dear Rooters,
>
> I'm tryng to make a "dynamic" canvas.
>
> I have an array of TBox and I want to plot it in a canvas, modify them
> and plot again.
>
> My problem is how to upload the canvas. I'm using the TApplication and
> what happen is that when I call the method Run(), the execution of the
> code seems does not proceed.
> I'm working on a compiled code.
>
> Here the code:
>
> main(int argc, char** argv){
> cout << "--> Initialization..." << endl;
>
>
> TApplication app("App", &argc, argv);
>
> FileReader FileIn("rates.dat");
>
> gROOT->SetStyle("Plain");
>
> TCanvas canvOne("canvOne", "One");
> gPad->Range(-2000,
> -2000,
> 2000,
> 2000);
>
> TCanvas cavTwo("canvTwo", "Two");
> gPad->Range(-2000,
> -2000,
> 2000,
> 2000);
>
> app.Run();
>
> }
>
> Thanks for your help
> Vito
>
>
Received on Sat Oct 17 2009 - 11:36:24 CEST

This archive was generated by hypermail 2.2.0 : Sat Oct 17 2009 - 23:50:03 CEST