Hi Roman,
So apparently I was not clear enough in my previous post, sorry about
that.
Replacing DeleteWindow() calls with DestroyWindow() is not a solution!
So, just to clarify, this code is WRONG:
GCluster::~GCluster()
{
//Remove frames
fC->DestroyWindow();
ftop->RemoveFrame(fC);
//delete fC;
button->DestroyWindow();
ftop->RemoveFrame(button);
//delete button;
}
...
void MyMainFrame::AddExit()
{
if(exit) {
exit->DestroyWindow();
fMain->RemoveFrame(exit);
//delete exit;
}
exit = new TGTextButton(fMain,"&Exit","gApplication->Terminate(0)");
fMain->AddFrame(exit, new TGLayoutHints(kLHintsCenterX,5,5,3,4));
}
You MUST NOT CALL "DeleteWindow()" or "DestroyWindow()" on GUI
Widgets!!!
Please take a look in the examples in $(ROOTSYS)/tutorials/gui
The code above should look like this:
GCluster::~GCluster()
{
delete button;
delete fC;
}
void MyMainFrame::AddExit()
{
if(exit) {
fMain->RemoveFrame(exit);
delete exit;
}
exit = new TGTextButton(fMain,"&Exit","gApplication->Terminate(0)");
fMain->AddFrame(exit, new TGLayoutHints(kLHintsCenterX,5,5,3,4));
}
And please send me a WORKING piece of code (your code crashes on all
platforms) with a proper makefile (yours doesn't generates the
dictionary)
Could you also tell me which ROOT version, which platform, and which
compiler you are using?
Cheers, Bertrand.
-----Original Message-----
From: Roman Lietava [mailto:rl_at_hep.ph.bham.ac.uk]
Sent: Wednesday, April 14, 2010 23:46
To: Bertrand Bellenot
Cc: Rene Brun; roottalk
Subject: RE: [ROOT] root GUI
Hi Bertrand,
thanks for suggestions, I've used them.
Code behaves now a bit better.
But crashes when I want to add third window (second is ok).
Also windows resizing is not perfect.
Please, have a look.
Thanks,
Roman.
On Mon, 12 Apr 2010, Bertrand Bellenot wrote:
> Hi Roman,
> >> I try to add/delete/modify windows dynamically, e.g. when run >> starts,stop.
> >> - is there somewhere example of gui with similar functionality ?
> >> - is there other documentation apart from >> ftp://root.cern.ch/root/doc/25WritingGUI.pdf ?
> >> - how can I debug errors a la bad windows ?
> which is not valid anymore...
>
>
>
>
>
>
>
>
>
> >
>
>
> > > >
--Received on Thu Apr 15 2010 - 09:54:16 CEST
This archive was generated by hypermail 2.2.0 : Thu Apr 15 2010 - 11:50:01 CEST