00001 #include <TH1.h>
00002 #include <TCanvas.h>
00003 #include <TQObject.h>
00004
00005 void exec3()
00006 {
00007
00008
00009
00010
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 }