Fixed closing root canvas issue using WaitPrimitive trick.

This commit is contained in:
2010-03-02 16:55:07 +00:00
parent 828b8ddd15
commit e14dd7303a
3 changed files with 31 additions and 25 deletions

View File

@ -114,9 +114,9 @@ void plotRge(TString &names)
rge[last]->GetXaxis()->SetTitle("depth (nm)");
rge[last]->GetYaxis()->SetTitle("normalized stopping distribution (nm^{-1})");
TCanvas *c1 = new TCanvas("c1", "rge plot");
TCanvas *c1 = new TCanvas("c1", "Range");
c1->Show();
rge[last]->Draw("apl");
rge[last]->GetYaxis()->SetRangeUser(min, 1.05*max);
@ -144,5 +144,13 @@ void plotRge(TString &names)
legend->Draw();
delete tokens;
// I am not sure what this does, but it waits until canvas is closed
c1->WaitPrimitive(" ");
cout << endl << "Canvas Closed" << endl ;
// Then quit root cleanly
gApplication->Terminate();
}