// C++ code for saving canvas with file dialog. Pure pyROOT solution is now unstable #include "TGFileDialog.h" #include "TPad.h" #include "TGClient.h" #include "TCanvas.h" #include "TGraph.h" #include "Rtypes.h" //#include //#int save_display() //{ static TString dir("."); TGFileInfo fi; fi.fIniDir = StrDup(dir); /* new TCanvas(); TGraph *g = new TGraph(); g->SetPoint(0, 0, 0); g->SetPoint(1, 1, 1); g->Draw("A*"); */ TGFileDialog *file_dialog = new TGFileDialog(gClient->GetRoot(), gClient->GetRoot(), kFDSave, &fi); //cout << fi.fFilename << endl; gPad->SaveAs(fi.fFilename); //return 0; //}