Logo ROOT   6.07/09
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 
10 TGPack *hp = 0;
11 TGPack *vp = 0;
12 
13 TGTextButton* b = 0;
14 
15 void pack()
16 {
17  TGMainFrame* mf = new TGMainFrame(0, 400, 300);
18  mf->SetWindowName("Foo");
19 
20  hp = new TGPack(mf, mf->GetWidth(), mf->GetHeight());
21  hp->SetVertical(kFALSE);
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 
34 
35  mf->Layout();
36  mf->MapSubwindows();
37  mf->MapWindow();
38 }
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
UInt_t GetWidth() const
Definition: TGFrame.h:287
const Bool_t kFALSE
Definition: Rtypes.h:92
UInt_t GetHeight() const
Definition: TGFrame.h:288
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
Definition: TGPack.h:39
void SetVertical(Bool_t x)
Sets the vertical flag and reformats the back to new stacking direction.
Definition: TGPack.cxx:597
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame f at the end with default weight.
Definition: TGPack.cxx:285
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void MapWindow()
Definition: TGFrame.h:267
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
virtual void AddFrameWithWeight(TGFrame *f, TGLayoutHints *l, Float_t w)
Add frame f at the end with given weight.
Definition: TGPack.cxx:275