SetBatch(kFALSE)?

Hi everyone, I posted this question in the PyROOT forum, but apparently it is not a PyROOT-specific problem. When I do gROOT->SetBatch(kTRUE) in a macro, indeed batch mode is entered and things are not drawn graphically. Unfortunately in the same macro if I later do gROOT->SetBatch(kFALSE), I am unable to create new non-batch canvases and graphical things.

Is SetBatch(kFALSE) a thing? Am I supposed to be able to “exit” batch mode and make graphical objects appear? Or is SetBatch(kTRUE) a one-way street, forcing me to do some workaround, like save the objects in a file and re-open them in a new ROOT session?

An alternate thing which would prevent my need for SetBatch() is if it was possible to pass to TH1::Draw an option like the “goff” option for TTree::Draw, which makes the drawing non-graphical. Does such an option exist?

Here is the original post.

Thanks,
Jean-François

can you post a small macro reproducing what you see ?

Hrm, a small macro trying to reproduce doesn’t reproduce the problem, it behaves as expected. Maybe it’s due to the way the bigger script is written, with the drawing inside a python function.

This study was minor and I was able to complete it while I went away from the computer for a while, letting it steal focus all it wanted. I probably won’t look more into it.

Jean-François