PyROOT GUI: import a TGCompositeFrame from separate file

Dear Rooters,

I would like to create a PyROOT GUI (gui.py) with a TGTab element into which I want to import a TGCompositeFrame from a separate file (frameToImport.py). However, when I do AddFrame, the imported Frame is located in a separate window instead of being placed in the tab.

Do you have any suggestions how to fix this?

Thanks,
Bojan

minimal_example.zip (2.6 KB)

Add fF2.mainW.ReparentWindow(fTab_T2):

    fTab_T2 = self.Tab.AddTab("tab 2")
    fF2 = importedFrame.myframe()
    fF2.mainW.ReparentWindow(fTab_T2)
    fTab_T2.AddFrame(fF2.mainW, fL)

The child frame must have the correct pointer to its parent…

That solves it. Thank you for a fast reply.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.