Revision 1ff8cfc023263a593b0e186877352756557e2553 authored by Rene Brun on 19 November 2004, 06:46:19 UTC, committed by Rene Brun on 19 November 2004, 06:46:19 UTC
# Default 3d Viewer # by default 3-D views are shown in the pad. # if the next line is activated, the default viewer will be OpenGL #Viewer3D.DefaultDrawOption: ogl git-svn-id: http://root.cern.ch/svn/root/trunk@10564 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 8524938
exec1.C
void exec1()
{
//example of macro called when a pad is redrawn
//one must create a TExec object in the following way
// TExec ex("ex",".x exec1.C");
// ex.Draw();
// this macro prints the bin number and the bin content when one clicks
//on the histogram contour of any histogram in a pad
int event = gPad->GetEvent();
if (event != 11) return;
int px = gPad->GetEventX();
TObject *select = gPad->GetSelected();
if (!select) return;
if (select->InheritsFrom("TH1")) {
TH1 *h = (TH1*)select;
Float_t xx = gPad->AbsPixeltoX(px);
Float_t x = gPad->PadtoX(xx);
Int_t binx = h->GetXaxis()->FindBin(x);
printf("event=%d, hist:%s, bin=%d, content=%f\n",event,h->GetName(),binx,h->GetBinContent(binx));
}
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...