{ Int_t w = 800; Int_t h = 600; TCanvas *c; gROOT->SetBatch(kFALSE); c = new TCanvas("c", "c", w, h); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh())); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; delete c; c = new TCanvas("c", "c", w, h); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; c->SetCanvasSize(w, h); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; delete c; gROOT->SetBatch(kTRUE); c = new TCanvas("c", "c", w, h); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh())); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; delete c; c = new TCanvas("c", "c", w, h); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; c->SetCanvasSize(w, h); c->Modified(); c->Update(); std::cout << c->GetWw() << " " << c->GetWh() << std::endl; }