The way to do that is to have the parent frame has a fixed width, and the children are added with kLHintsExpandX layout hints, i.e. your code will work if you change it the following way:
TGHorizontalFrame *fHD = new TGHorizontalFrame(fMain,700,30,kChildFrame | kFixedWidth);
fMain->AddFrame(fHD,new TGLayoutHints(kLHintsLeft | kLHintsBottom | kLHintsExpandX));
fTBok = new TGTextButton(fHD,"Ok");
fTBcancel = new TGTextButton(fHD,"Cancel");
fHD->AddFrame(fTBcancel, new TGLayoutHints(kLHintsExpandX ,2,0,2,2));
fHD->AddFrame(fTBok, new TGLayoutHints(kLHintsExpandX ,2,0,2,2));
Cheers, Ilka
Your example creates two text buttons having summary width that is equal to the fHD width. I wanted to have two small buttons placed in the right bottom corner of the frame. In pricipal, I can divide fHD frame on two frames and put all text buttons in the new right frame. But, is it possible to exclude these additional frames?