Open antonioiuliano2 opened 3 years ago
I can reproduce the problem. The TK window does not show up anymore automatically, no idea why. You need to type SHiPDisplay.ioBar.master.mainloop() However, this takes control, and the terminal is blocked. No idea how to get back the previous behavior, have the tk window and the terminal in parallel.
Maybe one could start the mainloop on a second thread or process? But that opens a whole new can of worms...
Is this due to a change in ROOT?
I have no clue. In principle, ROOT is not used. It is only python and tkinter. Did it worked with ship-2020?
If we can figure out what exactly causes this regression, maybe we can figure out how to return to the previous behaviour...
Dear Thomas and Oliver, thank you for your answers, I have just followed Thomas' advice and recovered the GUI. However, when I try to draw an event I get the following error:
Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.8/tkinter/init.py", line 1883, in call return self.func(*args) File "/home/utente/SHIPBUILD/FairShip/macro/eventDisplay.py", line 510, in nextEvent SHiPDisplay.NextEvent(self.n) File "/home/utente/SHIPBUILD/FairShip/macro/eventDisplay.py", line 596, in NextEvent p.SetTitle(p.repr()) File "/home/utente/SHIPBUILD/sw/ubuntu1604_x86-64/FairShip/master-1/python/decorators.py", line 67, in TEvePointSetPrintOut x,y,z = ROOT.Double(),ROOT.Double(),ROOT.Double() File "/home/utente/SHIPBUILD/sw/ubuntu1604_x86-64/ROOT/ship-v6-22-02_FAIRSHIP-1/lib/ROOT/_facade.py", line 163, in _fallback_getattr raise AttributeError("Failed to get attribute {} from ROOT".format(name)) AttributeError: Failed to get attribute Double from ROOT
May it be connected?
no. Double does not exist anymore in the new ROOT version. What version of eventdisplay do you use?
The version from master branch, macro/eventDisplay.py. However, the call to Double() comes from python/decorators.py, and it is still present: https://github.com/ShipSoft/FairShip/blob/master/python/decorators.py (line 67):
x,y,z = ROOT.Double(),ROOT.Double(),ROOT.Double()
ok, needs to be replaced with import ctypes x,y,z = ctypes.c_double(),ctypes.c_double(),ctypes.c_double()
reading about tkinter, I am now wondering how it ever worked before. The master object should be constantly in a loop to wait for input from the GUI, which blocks the input via prompt. However, none of the ROOT GUI has this problem, like TBrowser or TEve. So, either I add an exit to the event display gui to give back control to the prompt, and the user has to give back control to the gui by typing SHiPDisplay.ioBar.master.mainloop(), or we find out how ROOT handles this.
Version: Ubuntu 20.04 LTS
When I launch eventDisplay.py, the additional GUI which allows me to select the event is missing. However, I do not see any error and the geometry is drawn correctly.
Do you have any info on the possible cause?
Best regards, Antonio