Root cern GUI: how to disable child objects?

Dear experts,

Is any simple way to disable all objects inside TGCompositeFrame?
When I say disable I mean I want to see objects without opportunity to change them.
For example, I have TGCompositeFrame with different objects inside: TGTextButton, TGNumberEntry, TGCheckButton etc. I can call for them SetState(kFALSE). Is any way to make this automatically for all objects inside?

Should I use Getlist()? Could give simple example?

Thank you in advance.


Something like this should work (I didn’t try):

   TGFrameElement *el;
   TIter next(GetList());
   while ((el = (TGFrameElement *) next())) {
      if (el->fFrame->InheritsFrom("TGTextButton"))
         ((TGTextButton *)el->fFrame)->SetEnabled(kFALSE);

Cheers, Bertrand.

1 Like

Dear Bertrand,
Thank you very much!
It works)

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