I have a GUI PyROOT app, with one window displaying TH2D, which, when clicked, displays another window with proper graphs. The point is, that the result of TCanvas.AbsPixelToX/Y() in the first window depend somehow on the contents of the graphs plotted in the second window. This looks some sort of memory leak, but it is… python.
I attach my app, stripped of most of the unnecessary code (it was pretty advanced, so stripping took me quite long - sorry for not needed GUI elements).
When mouse is hovering over the TH2D in the main window, the coordinates of canvas are displayed (GetEventX/Y() and AbsPixelToX/Y(), lines 100-105). When one clicks a “pixel” on TH2D second window opens. From the second window, from the menu, please select Analysis->Derivative. Then click on the TH2D again. You can spot, that coordinates from AbsPixelToX/Y() are wrong when clicking (but not when hovering!). When clicking for the second time, they are OK
However, if you change the content of the graph that is draw after choosing Analysis->Derivative, the coordinates can be correct. To do this comment line 359 and uncomment 360. So the number of point in the graph is the same, but the range is divided by 10…
What can be wrong?
etos.py (13.3 KB)