ROOT
6.14/05
Reference Guide
tutorials
eve
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);
29
hp->
AddFrame
(vp,
new
TGLayoutHints
(
kLHintsExpandX
|
kLHintsExpandY
));
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
}
TGTextButton
Definition:
TGButton.h:142
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition:
TGFrame.cxx:1746
kLHintsExpandY
Definition:
TGLayout.h:38
TGFrame::GetHeight
UInt_t GetHeight() const
Definition:
TGFrame.h:272
TGFrame::GetWidth
UInt_t GetWidth() const
Definition:
TGFrame.h:271
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition:
TGFrame.cxx:1239
kLHintsExpandX
Definition:
TGLayout.h:37
TGPack
Definition:
TGPack.h:39
TGPack::SetVertical
void SetVertical(Bool_t x)
Sets the vertical flag and reformats the back to new stacking direction.
Definition:
TGPack.cxx:597
kFALSE
const Bool_t kFALSE
Definition:
RtypesCore.h:88
TGPack::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame f at the end with default weight.
Definition:
TGPack.cxx:285
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition:
TGFrame.cxx:1099
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition:
TGFrame.cxx:1146
TGFrame::MapWindow
virtual void MapWindow()
Definition:
TGFrame.h:251
b
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
TGPack::AddFrameWithWeight
virtual void AddFrameWithWeight(TGFrame *f, TGLayoutHints *l, Float_t w)
Add frame f at the end with given weight.
Definition:
TGPack.cxx:275
TGLayoutHints
Definition:
TGLayout.h:57
TGMainFrame
Definition:
TGFrame.h:466