Dear ROOTers,
I can not write a PostScript file using the macro shwon in below.
--- Log of the macro --------------------------------------
root [0] .x t.cxx
Processing t.cxx...
Now updating canvas...
*** Break *** segmentation violation
---------------------------------------------------------------
I found that the macro crashes at c1->Update().
I can draw the histogram on the CRT, if I change PS=0.
Could you let me know what is the problem?
I am using the following system.
ROOT version 2.24/05
Compaq Digital UNIX version 4.0
Compaq C++ version 6.2
I rebuilt the ROOT system on my machine.
Best Regards,
Etoh
--- Macro "t.cxx" -----------------------------------------
{
gROOT->Reset();
const int PS = 1;
TH1F *h1 = new TH1F("h1", "", 50, -1, 1);
for (int i=0; i<10000; ++i) {
h1->Fill(gRandom->Gaus(0, 0.3));
}
TCanvas *c1 = new TCanvas("c1", "", 800, 600);
if (PS) {
TPostScript *ps = new TPostScript("./t.ps", 111);
}
h1->Draw();
printf("Now updating canvas...\n");
c1->Update();
printf("Canvas was updated.\n");
if (PS) {
ps->NewPage();
}
if (PS) {
ps->Close();
}
}
---------------------------------------------------------------
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:29 MET