#include #include #include using namespace std; vector addc(vector clist, TCanvas * c) { TCanvas * cnew = (TCanvas*) c->Clone(); clist.push_back(cnew); return clist; } # ifndef __CINT__ int main() { vector clist; TCanvas * c = new TCanvas("c","c",600,100); c->Print("./temp_before_0.pdf"); cout << c->GetWindowWidth() << ", " << c->GetWindowHeight() << endl; clist = addc(clist,c); c = new TCanvas("c","c",100,600); c->Print("./temp_before_1.pdf"); cout << c->GetWindowWidth() << ", " << c->GetWindowHeight() << endl; clist = addc(clist,c); clist[0]->Print("./temp_after_0.pdf"); cout << clist[0]->GetWindowWidth() << ", " << clist[0]->GetWindowHeight() << endl; clist[1]->Print("./temp_after_1.pdf"); cout << clist[1]->GetWindowWidth() << ", " << clist[1]->GetWindowHeight() << endl; return 0; } # endif