Re: mouse button: 2 questions

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Thu, 14 Apr 2005 08:29:47 +0200 (MEST)


When you run the script test.C, the function exectest is known to CINT. If you type the commands without telling CINT where to find the function, it is clear that it cannot work. I suggest adding the following line
  gROOT->ProcessLine(".L exectest.C")
before executing:

   c1->AddExec("test","exectest()");

where exectest.C is a file containing only the function exectest

Rene Brun

On
Wed, 13 Apr 2005 alexis.cothenet_at_free.fr wrote:

> Hi all,
>
> I have two questions about the macro that i put in attachment.
>
> 1) If i run it like this, it works well.
> But if i prefer to do in root:
> TFile * f = new TFile("test.root","RECREATE");
> TH1F * hALL = new TH1F("hALL","hALL",100,-3,3);
> hALL->FillRandom("gaus",1000);
> f->Write();
> and then to change test() like this:
> //TH1F * hALL = new TH1F("hALL","hALL",100,-3,3);
> TFile f("test.root","READ") ;
> // hALL->FillRandom("gaus",1000);
> TCanvas * c1 = new TCanvas("c1");
> hALL->Draw();
> c1->Update();
> c1->AddExec("test","exectest()");
>
>
> I cannot see any more the hitogramm hALL...it seems to be masked by something
> empty...do you understand my problem ?
>
> 2) once i clicked on the canvas with the mouse and that some markers appeared,
> i'd like to be able to move some of them at another place in the canvas by the
> way of the mouse.
> Could you explain me how to do that ?
>
> Thank you a lot by advance!
>
> Regards,
> Alexis
>
>
Received on Thu Apr 14 2005 - 08:29:52 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET