Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsExpandX
Definition TGLayout.h:30
UInt_t GetHeight() const
Definition TGFrame.h:225
UInt_t GetWidth() const
Definition TGFrame.h:224
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
Stack of frames in horizontal (default) or vertical stack.
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:265
void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr) override
Add frame f at the end with default weight.
Definition TGPack.cxx:275
void SetVertical(Bool_t x)
Sets the vertical flag and reformats the back to new stacking direction.
Definition TGPack.cxx:569
Yield an action as soon as it is clicked.
Definition TGButton.h:142
Author
Matevz Tadel

Definition in file pack.C.