GUI works!

Radovan Chytracek (Radovan.Chytracek@cern.ch)
Fri, 13 Mar 1998 01:05:07 +0100 (MET)


Hello ROOTers,

probably I have to establish my personal ROOT related
mailing list for CRASH & SOLVED topics :-)).
I always solve my problem after sending e-mail to this list.
Again I have no problem after reimplementing my previous macros
into the following single macro with the effect I expected:

// First interactive GUI interface in ROOT
#include <iostream.h>
int tgr()
{
TGMainFrame *rMFrm = new TGMainFrame(gClient->GetRoot(), 50, 50);

TGCompositeFrame *rCFrm = new TGCompositeFrame(rMFrm, 50, 50,
kHorizontalFrame|kSunkenFrame );

TGButton *rPBut = new TGPictureButton( rMFrm,
gClient->GetPicture("beeravatar.xpm"),
"rAction();",
1
);

rPBut->Associate(rMFrm);

rCFrm->AddFrame(rPBut, new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));

rMFrm->AddFrame(rCFrm, new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));

rMFrm->SetWindowName("First Rado's ROOT GUI");

rMFrm->MapSubwindows();

rMFrm->Resize(rMFrm->GetDefaultSize());

rMFrm->MapWindow();

return 0;
}

void rAction()
{
cout << "Pushed..." << endl;
}

So it works now & I can go ahead with ROOT 2.0 new GUI. It's perfect
to build GUI interactively. I liked it with Tcl/Tk but this seems to
me much more elegant solution.

Happy ROOTing

Radovan