Hello,
This is a follow-up to ROOT 6.22.02 and pyROOT GUI to which I can’t reply any more, because it is closed.
Thanks for the update! I’ve compiled, it works, but there are still issues. Some of them are probably bugs in ROOT, some of them may be bugs in my code that were tollerated by the previous pyROOT. Sorry if I can’t always distinguish between them.
- Before I needed to create a custom class in C++ to handle TGListView events in pyROOT. I am not sure what should be done now. For sure, the old way of creating the custom class does not work anymore, because:
/home/lewhoo/workspace/etos/cpp_helpers/etos_dispatcher.C:3:10: fatal error: 'TPyDispatcher.h' file not found
- When I moved mouse over my toolbar, I’ve got the following error and the crash. Unfortunately it does not say where in my code it happened:
input_line_317:1:64: error: redefinition of 'is_equal'
namespace __cppyy_internal { template<class C1, class C2> bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); } }
^
input_line_13:1:64: note: previous definition is here
namespace __cppyy_internal { template<class C1, class C2> bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); } }
^
input_line_318:1:64: error: redefinition of 'is_not_equal'
namespace __cppyy_internal { template<class C1, class C2> bool is_not_equal(const C1& c1, const C2& c2) { return (bool)(c1 != c2); } }
^
input_line_14:1:64: note: previous definition is here
namespace __cppyy_internal { template<class C1, class C2> bool is_not_equal(const C1& c1, const C2& c2) { return (bool)(c1 != c2); } }
^
*** Break *** segmentation violation
I’ve noticed that the same happens when exiting the gui_ex.py from the tutorial:
lewhoo@lwpcomp2 pyroot]$ python2 -i gui_ex.py
>>> input_line_92:1:64: error: redefinition of 'is_equal'
namespace __cppyy_internal { template<class C1, class C2> bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); } }
^
input_line_13:1:64: note: previous definition is here
namespace __cppyy_internal { template<class C1, class C2> bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); } }
^
input_line_93:1:64: error: redefinition of 'is_not_equal'
namespace __cppyy_internal { template<class C1, class C2> bool is_not_equal(const C1& c1, const C2& c2) { return (bool)(c1 != c2); } }
^
input_line_14:1:64: note: previous definition is here
namespace __cppyy_internal { template<class C1, class C2> bool is_not_equal(const C1& c1, const C2& c2) { return (bool)(c1 != c2); } }
- This may not be a bug, but for some reason, a long time ago, I needed to replace the MapSubwindows() function in my class deriving form TGMainFrame with:
# Hook over the original MapSubwindows - it shows even the hidden frames
def MapSubwindows(self):
super(pMainFrame,self).MapSubwindows()
if self.cur_avg_gtus<2:
self.MainFrame.HideFrame(self.AvgNavigationBar)
This doesn’t work anymore:
File "/home/lewhoo/workspace/etos/etoswindows/mainwindow.py", line 2332, in MapSubwindows
super(pMainFrame,self).MapSubwindows()
RuntimeError: void TGCompositeFrame::MapSubwindows() =>
RuntimeError: void TGCompositeFrame::MapSubwindows() =>
RuntimeError: void TGCompositeFrame::MapSubwindows() =>
...
RuntimeError: void TGCompositeFrame::MapSubwindows() =>
RuntimeError: maximum recursion depth exceeded while calling a Python object
I just commented out this replacement and my program seems to work OK, but I can’t be sure yet, especially that I am not sure what was happening a long time ago without this replacement. However, maybe it will be some hint to you
- Probably a feature, not a bug, or rather a bug in my code that is not tolareted any longer. Still, it is an incompatibility, so I report.
I have my main class deriving from the TGMainFrame, and inside the init() I set:
self.data_tree = data_tree
later, I create a panel in the same init:
self.DrawPanelDock = ROOT.TGDockableFrame(self.MainHorFrame, widgetsIds.wDrawPanelDock)
self.draw_panel = pDrawPanel(self.DrawPanelDock, self.DrawPanelDock)
where
class pDrawPanel(ROOT.TGMainFrame):
## Constructor
def __init__(self, parent, main_window):
...
ROOT.TGMainFrame.__init__(self, parent, width, height)
self.main_window = main_window.GetParent().GetParent()
The last line was giving in the old pyroot object of type:
<class 'etoswindows.mainwindow.pMainFrame'>
and now is giving:
<class cppyy.gbl.TGMainFrame at 0x55a922433eb0>
And the current object does not have the attributes of my main window that I set in its constructor. Not a big problem, I just pass the main window to the init function of the dock as I should have done probably from the beginning, but I report this different behaviour.
More testing will come, I guess, after fixing the bug (2), as at the moment it prevents my app for working properly