I’d like to make my pyROOT app ROOT 6 ready for one day when it will have windows support and will be adopted by more tools. However, there are problems:
ROOT.gVirtualX.GrabKey(self.GetId(), ROOT.gVirtualX.KeysymToKeycode(ROOT.kKey_j), ROOT.kKeyControlMask, True) and similar do not work. I get:
RuntimeWarning: creating converter for unknown type “TTVirtualX**”
What should be used instead?
if ROOT.gPad.GetEvent() == ROOT.EEventType.kButton1Down:
AttributeError: type object ‘int’ has no attribute ‘kButton1Down’
I’ve tried perhaps 3 different enumerations in pyROOT 6, and all of them resolve to “int”. What should be used instead?
I can’t go further with errors in my app before resolving those, so there may be many more similar errors awaiting. Is there any document about migration from ROOT 5 to ROOT 6?
Calling TGWindow with ROOT.gClient.GetRoot() as an argument crashes the app - visible when one tries to execute gui_ex.py from tutorials. I found on this forum that it can be fixed with providing ROOT.TGClient.Instance().GetRoot() instead. What is the reason for keeping a broken version of gui_ex.py?
Replace ROOT.gVirtualX with ROOT.TVirtualX.Instance(). So, perhaps ROOT.gVirtualX could be initialised to this by default?
I understand that in ROOT 6 enums are directly put into ROOT.*, so I need to check ROOT.kButton1Down instead of ROOT.EEventType.kButton1Down. I guess this is intentionall, but if in addition the old “addressing” could be restored, it would increase the compatibility…
I am afraid there is no specific guide of how to migrate your PyROOT application from ROOT 5 to 6, but we will gladly answer your questions in this forum in case more issues arise.
Regarding the gui_ex.py tutorial, thank you for spotting that, we will fix it.
Hmm, I am not sure how should I use that. ROOT.TVirtualX.Instance() returns TVirtualX, on which I can call GrabKey() (that’s what I use it for). While ROOT.gApplication.InitializeGraphics() returns void…
Thanks for the suggestion, we are actually creating a Howto integrated in the new forum so that we can more easily redirect users to previously answered questions that are common.