ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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:146
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:44
TGFrame::GetWidth
UInt_t GetWidth() const
Definition:
TGFrame.h:287
kFALSE
const Bool_t kFALSE
Definition:
Rtypes.h:92
TGFrame::GetHeight
UInt_t GetHeight() const
Definition:
TGFrame.h:288
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition:
TGFrame.cxx:1239
kLHintsExpandX
Definition:
TGLayout.h:43
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
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:267
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:63
TGMainFrame
Definition:
TGFrame.h:482