Re: Canvas pointers

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Dec 16 1998 - 09:45:18 MET


ryan roth wrote:
> 
> Hello all:
> 
> Sorry about the previous message -- I had meant to cancel it and ended up
> sending it instead.
> 
> My question was:
> 
> If, within a program,  I create a TCanvas object and retain a pointer to
> it, and then the user closes canvas window, what is the best way for the
> program to examine the pointer and find out that the canvas has been closed?
> 

You can look for a canvas by its name in the list of canvases.
  
 TCanvas *myCanvas =
(TCanvas*)gROOT->GetListOfCanvases()->FindObject("myCanvas");

if (myCanvas == 0) your canvas has been deleted.

Note that this technique can be applied to all named objects
for which gROOT has the corresponding container (see class TROOT).

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:41 MET