Fixed closing root canvas issue using WaitPrimitive trick.
This commit is contained in:
@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user