swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Raw File
Tip revision: 0dbe27a530b2ce869210c10636b4b51e85420bc4 authored by Axel Naumann on 13 June 2018, 10:10:40 UTC
Update ROOT version files to v6.14/00.
Tip revision: 0dbe27a
pack.C
/// \file
/// \ingroup tutorial_eve
/// Demonstrates usage of class TGPack.
///
/// \image html eve_pack.png
/// \macro_code
///
/// \author Matevz Tadel

TGPack *hp = 0;
TGPack *vp = 0;

TGTextButton* b = 0;

void pack()
{
   TGMainFrame* mf = new TGMainFrame(0, 400, 300);
   mf->SetWindowName("Foo");

   hp = new TGPack(mf, mf->GetWidth(), mf->GetHeight());
   hp->SetVertical(kFALSE);

   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);
   hp->AddFrame(vp, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));

   b = new TGTextButton(hp, "Cilnouk");  hp->AddFrame(b);

   mf->AddFrame(hp, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));

   mf->Layout();
   mf->MapSubwindows();
   mf->MapWindow();
}
back to top