Skip to content
Snippets Groups Projects
Commit 6aa6fdba authored by Axel Naumann's avatar Axel Naumann
Browse files

[v7graph tutorial] Do not SaveAs in batch mode until it works.

parent d252c929
No related branches found
No related tags found
No related merge requests found
......@@ -49,5 +49,7 @@ void draw_th1() {
canvas->Draw(pHist2)->SetLineColor(Experimental::RColor::kBlue);
canvas->Show();
canvas->SaveAs("th1.png");
// Saving to PNG doesn't work reliably in batch yet:
if (!gROOT->IsWebDisplayBatch())
canvas->SaveAs("th1.png");
}
......@@ -52,14 +52,17 @@ void draw_v6()
canvas->Update(false,
[](bool res) { std::cout << "Second Update done = " << (res ? "true" : "false") << std::endl; });
// request to create PNG file in asynchronous mode and specify lambda function as callback
// when request processed by the client, callback invoked with result value
canvas->SaveAs("draw.png", true,
[](bool res) { std::cout << "Producing PNG done res = " << (res ? "true" : "false") << std::endl; });
// Saving to PNG doesn't work reliably in batch yet:
if (!gROOT->IsWebDisplayBatch()) {
// request to create PNG file in asynchronous mode and specify lambda function as callback
// when request processed by the client, callback invoked with result value
canvas->SaveAs("draw.png", true,
[](bool res) { std::cout << "Producing PNG done res = " << (res ? "true" : "false") << std::endl; });
// this function executed in synchronous mode (async = false is default),
// mean previous file saving will be completed as well at this point
canvas->SaveAs("draw.svg"); // synchronous
// this function executed in synchronous mode (async = false is default),
// mean previous file saving will be completed as well at this point
canvas->SaveAs("draw.svg"); // synchronous
}
// hide canvas after 10 seconds - close all connections and close all opened windows
// gSystem->Sleep(10000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment