I am trying to create a simple GUI, with a couple of histograms created in the constructor. I’m trying to access some histo properties when selecting a specific a radiobutton, though I am currently getting a segfault. I am attching a MWE.
Thanks a lot Bertrand, indeed it works now very well.
May I ask what are the main differences, and which way is recommended (because I’ve seen examples both ways) between inheriting from TGMainFrame and having a private TGMainFrame member ? Why this affects ownership of the histograms in this case ?
This doesn’t change the ownership, but the dictionary (signal/slots) generation. If you use ClassDef, then your class should inherit from TObject (TGMainFrame in this particular case).
And I would advise to always inherits from TGMainFrame if your class is a TGMainFrame (then it inherits also its signal/slots capability).