Canvas disappear when using graphic interface

Hello everybody,

I am facing the problem that whenever I use the graphic interface to interact with a canvas (e.g. fitting the histo in it with Fit Panel, Change the color of the histo in it, ecc.) created with pyroot, the windows with the canvas disappear.
There is no crash and python keeps on running but I can no more see the canvas windows on the screen.
I do not have the same problem when performing similar actions on canvases create by root (using the c++ language in general).

For example, if I code a simple macro, called example.py, like:

[code]import ROOT

h = ROOT.TH1F(“gauss”,“Example histogram”,100,-4,4)
h.FillRandom(“gaus”)
c = ROOT.TCanvas(“myCanvasName”,“The Canvas Title”,800,600)
h.Draw()[/code]

and then I run it with the command

I get, as expected,the windows with the canvas in output.
Anyway, as soon as I click on the Tools->Fit Panel in the top bar, the windows with the canvas disappear even if python keeps on running on the shell.

Does anyone know why this is happening?
Can you suggest me a solution?

I am actually running under root-6.08.02 on macOS Sierra (but I was facing the same problem with all the previous version of both OS and root).
I am using python2.7 (installation located in $/Library/Frameworks/Python.framework/Versions/2.7/bin/python$).
Environment variable are set as follow

export PYTHONDIR=/Library/Frameworks/Python.framework/Versions/2.7/bin/python export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH

I have looked on the forum but I found no similar issues.

Hi,

I just tried to carry out the operations you describe and I could not reproduce the issue.
What happens if you close your script with raw_input omitting the -i in the python invocation?

Cheers,
D

Hi,

Thanks for the replay.

Unfortunately I get the same problem.

Cheers,
Olmo

Hi Olmo,

could you attach a debugger to the process to see what is going on?

Cheers,
D

Hi,

Adding to Danilo: where did you get ROOT from? Did you build it yourself?

If so, what’s the configuration you used?

Cheers, Axel.

Hi,

I built it from source code using

cmake ../../root-6.08.02 -Dhttp=ON -Droofit=ON -Dx11=ON -Dmemstat=ON -Dfail-on-missing=ON -Dpython=ON cmake --build . -- -j4

What do you mean by attaching a debugger?
The process does not stop, simply the windows disappear as if it was hidden somewhere.

Cheers,
Olmo

Hi,

Why did you configure with x11 and not cocoa (the default)? I’d just remove -Dx11=On.

Cheers, Axel.

Hi,

I tried with that configuration too but the problem still remain.
I have seen that the last year a similar topic has been created (Window disappearing) but it has not been resolved yet…

Do you know wether the problem depends on python or on ROOT interface?

Thanks again,

Olmo

Hi,

Which python do you use? Could you attach CMakeCache.txt?

Cheers, Axel.