Logo ROOT  
Reference Guide
pack.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve
3/// Demonstrates usage of class TGPack.
4///
5/// \image html eve_pack.png
6/// \macro_code
7///
8/// \author Matevz Tadel
9
10TGPack *hp = 0;
11TGPack *vp = 0;
12
13TGTextButton* b = 0;
14
15void pack()
16{
17 auto mf = new TGMainFrame(0, 400, 300);
18 mf->SetWindowName("Foo");
19
20 hp = new TGPack(mf, mf->GetWidth(), mf->GetHeight());
22
23 b = new TGTextButton(hp, "Ailaaha"); hp->AddFrame(b);
24
25 vp = new TGPack(hp, hp->GetWidth(), hp->GetHeight());
26 b = new TGTextButton(vp, "Blaaaaa"); vp->AddFrameWithWeight(b, 0, 5);
27 b = new TGTextButton(vp, "Blooooo"); vp->AddFrameWithWeight(b, 0, 3);
28 b = new TGTextButton(vp, "Bleeeee"); vp->AddFrameWithWeight(b, 0, 5);
30
31 b = new TGTextButton(hp, "Cilnouk"); hp->AddFrame(b);
32
33 mf->AddFrame(hp, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
34
35 mf->Layout();
36 mf->MapSubwindows();
37 mf->MapWindow();
38}
#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