How to programmatically set TGPack's splitter positions?

Dear Rooters,

I came across the TGPack, which I think is great. I save and restore the splitter positions when my application stops and starts, using AddFrameWithWeight(). (The values come from the TGFrameElementPack.)

I’ve been trying to programmatically set the splitter positions, but I haven’t been able to get it right. For example, one command button would set all the splitters in certain positions to resize their contents, and another button would set the splitters to different positions.

How can I dynamically repositions all the splitters and resize their contents?

This is root 5.27.06 on Win/XP.

Thanks very much,
buddy

Hi buddy,

Well, as far as I can see, you cannot… But I’ll ask the original author anyway :wink:

Cheers, Bertrand.

Hi Buddy,

Bertrand is right, currently there are no methods that would allow you to do that.

Your best option is to sub-class TGPack and add your methods there.
As an example how the code there should look, see TGPack:EqualizeFrames():
root.cern.ch/root/htmldoc/TGPack … lizeFrames
root.cern.ch/root/htmldoc/src/TG … tml#k8XmJE

Let me know if you need some help.

Eventually we can add this functionality to TGPack but this can only come after 5.28 is out. Which means next year, and it will not be in 5.28 release.

Cheers,
Matevz