Dear all,
I am trying to write a GUI which has 2x2 of equally-sized sub-frames, each of which is composed of a TRootEmbeddedCanvas (and other widgets).
I want the embedded canvases to expand or shrink when the main window is resized.
I first implemented it using two horizontal composite frames nested in a vertical one, but I am hoping to implement with more (logically) organized way.
Blow, I tried to use TGMatrixLayout, but the canvases are not expanded with the main window.
TGMatrixLayout *tl = new TGMatrixLayout(mainFrame, 2, 2);
mainFrame->SetLayoutManager(tl);
for (int i = 0; i < 4; ++i) {
TRootEmbeddedCanvas *fCanvas =
new TRootEmbeddedCanvas(Form("Ecanvas%d", i), mainFrame, 200, 200);
mainFrame->AddFrame(fCanvas, new TGLayoutHints(kLHintsExpandX | LHintsExpandY));
}
TGTableLayout or TGTileLayout sound useful for this purpose, but I couldn’t quite understand how to use them.
I would very much appreciate your advice.