exec3.C

Go to the documentation of this file.
00001 #include <TH1.h>
00002 #include <TCanvas.h>
00003 #include <TQObject.h>
00004 
00005 void exec3()
00006 {
00007    // Example of using signal/slot in TCanvas/TPad to get feedback
00008    // about processed events. Note that slots can be either functions
00009    // or class methods. Compare this with tutorials exec1.C and exec2.C.
00010    //Author: Ilka Antcheva
00011    
00012    TH1F *h = new TH1F("h","h",100,-3,3);
00013    h->FillRandom("gaus",1000);
00014    TCanvas *c1=new TCanvas("c1");
00015    h->Draw();
00016    c1->Update();
00017    c1->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", 0, 0,
00018                "exec3event(Int_t,Int_t,Int_t,TObject*)");
00019 }
00020 
00021 void exec3event(Int_t event, Int_t x, Int_t y, TObject *selected)
00022 {
00023    TCanvas *c = (TCanvas *) gTQSender;
00024    printf("Canvas %s: event=%d, x=%d, y=%d, selected=%s\n", c->GetName(),
00025           event, x, y, selected->IsA()->GetName());
00026 }

Generated on Tue Jul 5 15:44:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1