#include #include #include using namespace std; class testGui2:public TObject{ // RQ_OBJECT("bax"); public: testGui(const TGWindow *p, UInt_t w, UInt_t h); virtual ~testGui(){}; //main frame TGMainFrame *mainFrame; //composite frame will hold my TGTextButton and TGListBox TGCompositeFrame* topFrame; TGTextButton* quitButton; TGListBox* listBox; ClassDef(testGui2,0); }; ClassImp(testGui2); testGui2::testGui2(const TGWindow *p, UInt_t w, UInt_t h){ mainFrame = new TGMainFrame(p,w,h); topFrame = new TGCompositeFrame(mainFrame, 10, 10, kHorizontalFrame | kFitWidth); // make the list box and put it into the top frame listBox = new TGListBox(topFrame); topFrame->AddFrame(listBox, new TGLayoutHints(kLHintsExpandX,2,2,2,2)); //give the box a height of 300pixels and width 700 listBox->Resize(700,300); //make the button and put it into the top frame quitButton = new TGTextButton(topFrame, "Quit"); topFrame->AddFrame(quitButton, new TGLayoutHints(kLHintsLeft|kLHintsCenterY,2,2,2,2)); //this had no effect... quitButton->Resize(500, 100); // add the composite frame to the main frame mainFrame->AddFrame(topFrame, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2)); mainFrame->SetWindowName("Test Program Fixed Widths"); mainFrame->MapSubwindows(); mainFrame->MoveResize(300, 300, 1000, 500); mainFrame->MapWindow(); } void testTheGui2(){ new testGui2(gClient->GetRoot(), 1, 1); }