problem with loaded function

Pasha Murat (murat@cdfsga.fnal.gov)
Sun, 28 Sep 1997 17:22:07 GMT


Hi, new week has not started yet but I've gotten a new confusion:

I've stolen the example ellipse.C from ROOT tutorials, cut it
and put on it jacket of function:
----------------------------------------- test.cxx
display_cot() {
gROOT->Reset();
c1 = new TCanvas("c1");
c1->Range(0,0,1,1);
TPaveLabel pel(0.1,0.8,0.9,0.95,"Examples of Ellipses");
pel.SetFillColor(42);
pel.Draw();
}
----------------------------------------------

Could anybody explain why after

root [0] .L test.cxx
root [1] display_cot()

only an empty canvas appears on the screen? The equivalent (for
naive user) macro
----------------------------------------- test.C
{
gROOT->Reset();
c1 = new TCanvas("c1");
c1->Range(0,0,1,1);
TPaveLabel pel(0.1,0.8,0.9,0.95,"Examples of Ellipses");
pel.SetFillColor(42);
pel.Draw();
}
----------------------------------------------
executed via command

root [2] .x test.C

draws also a label (what naive user would expect)

Thanks a lot, pasha