Array of TGFrames

I am building a GUI that requires 8 Embedded Canvases arranged in two columns and four rows. I can write the code to create and arrange the canvases nicely, but would prefer to use a for loop and arrays of objects. However, I have great difficulty with the TGVerticalFrame, TGHorizontalFrame, and TGTextEntry objects in this context.

Could someone suggest the appropriate way to declare these objects as arrays and add them to the main frame? I have included a snippet of my code which declares each object with its own pointer variable. Objects such as TGLabel don’t give me problems.

Thank you,

help_request.C (3.99 KB)

Hi Mike,

This way is used in TFitParametersDialog class, which creates ‘on the fly’ the dialog according to the number of function parameters (fNP). Please have a look in the constructor how the following data members are created (see … tml#hKS_0D ) TGTextEntry **fParNam; // parameter names TGCheckButton **fParBnd; // bound setting switch TGCheckButton **fParFix; // fix setting switch TGNumberEntry **fParVal; // parameter values TGNumberEntryField **fParMin; // min range values TGNumberEntryField **fParMax; // max range values TGNumberEntry **fParStp; // step values TGTripleHSlider **fParSld; // triple sliders TGNumberEntryField **fParErr; // error values The attached file shows how this dialog looks like. Any array of GUI elements is added to a vertical frame with fixed width. All vertical frames have as a parent a single horizontal frame. The use of kLHintsExpandX and the numbers in TGLayoutHints are important for the final look.

Cheers, Ilka

Thanks, I was able to implement those techniques. Attached is my final code in case someone else has a similar problem.
post.cpp (2.34 KB)