Logo ROOT  
Reference Guide
pack.C File Reference

Detailed Description

Demonstrates usage of class TGPack.

TGPack *hp = 0;
TGPack *vp = 0;
void pack()
{
auto mf = new TGMainFrame(0, 400, 300);
mf->SetWindowName("Foo");
hp = new TGPack(mf, mf->GetWidth(), mf->GetHeight());
b = new TGTextButton(hp, "Ailaaha"); hp->AddFrame(b);
vp = new TGPack(hp, hp->GetWidth(), hp->GetHeight());
b = new TGTextButton(vp, "Blaaaaa"); vp->AddFrameWithWeight(b, 0, 5);
b = new TGTextButton(vp, "Blooooo"); vp->AddFrameWithWeight(b, 0, 3);
b = new TGTextButton(vp, "Bleeeee"); vp->AddFrameWithWeight(b, 0, 5);
b = new TGTextButton(hp, "Cilnouk"); hp->AddFrame(b);
mf->AddFrame(hp, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
mf->Layout();
mf->MapSubwindows();
mf->MapWindow();
}
#define b(i)
Definition: RSha256.hxx:100
const Bool_t kFALSE
Definition: RtypesCore.h:90
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsExpandX
Definition: TGLayout.h:37
UInt_t GetHeight() const
Definition: TGFrame.h:250
UInt_t GetWidth() const
Definition: TGFrame.h:249
Definition: TGPack.h:40
virtual void AddFrameWithWeight(TGFrame *f, TGLayoutHints *l, Float_t w)
Add frame f at the end with given weight.
Definition: TGPack.cxx:275
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame f at the end with default weight.
Definition: TGPack.cxx:285
void SetVertical(Bool_t x)
Sets the vertical flag and reformats the back to new stacking direction.
Definition: TGPack.cxx:597
Author
Matevz Tadel

Definition in file pack.C.