Re: [ROOT] still on bars and buttons

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 15 2001 - 15:08:43 MEST


Hi Primrose,	

On Wed, 15 Aug 2001, Primrose Mbanefo wrote:

> Hello everyone,
> 1. Is there a test I can use to know if there is a current pad? Something 
> like 'if (gPad) ...'

You can test gROOT->GetListOfCanvases()->GetSize();

> 2. I'm not able to
use the ForEach script. In fact I tried:
> 	gROOT->GetListOfCanvases()->ForEach(TCanvas,Close)();
>   and I got the following message:
> 	Error: No symbol TCanvas in current scope  FILE:/tmp/fileQy0mGM_cint LINE:1
> 	Error: No symbol Close in current scope  FILE:/tmp/fileQy0mGM_cint LINE:1
> 	*** Interpreter error recovered ***
> Where did I go wrong?

You cannot use the macro Foreach with the interpreter. Replace your Close 
statement with:

gROOT->GetListOfCanvases()->Delete();

> and 
> 3.
> In order to have horizontal control bars I use TRootControlbar but it's 
> CloseWindow method which is called when one closes the bar deletes the object 
> which another button might try to use.
> How can I test if this object has been deleted or how can I change the method 
> called?

You do not provide enough information

Rene Brun

> Thank you.
> Primrose
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:57 MET