Re: [ROOT] TButton vs Canvas deletion

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Mar 16 2001 - 23:22:10 MET


Hi Stephane,

You cannot place a TButton or any other graphics object in the pad
you want to clear. If you want to build a good user interface,
I strongly suggest you use the TGxxx classes as illustrated in
$ROOTSYS/test/guitest.cxx.
TButton was a class implemented before we had the new TGxxx classes.
If you want to use TButton, I suggest the following:
Assuming a TCanvas c1, create a subpad Buttons and another subpad Work.
In Buttons, you draw all your buttons, in Work you draw your graphics
objects.

You can see an example in function ATLFDisplay::DisplayButtons
of the ATLFast package. See URLs:
  http://root.cern.ch/root/Atlfast.html
  http://root.cern.ch/root/html224/atlfast/ATLFDisplay.html

Rene Brun

On Fri, 16 Mar 2001, Stephane Tourneur wrote:

> 
> Deer rooters,
> 
> I'm trying to make a very simple histogramming display using TButtons
> inside a TCanvas. I'd want my TCanvas to be cleared and updated by
> pressing a button inside this same TCanvas. Doing that I get a
> segmentation violation error : I suppose that it is due to the fact that 
> a TButton's method can't delete the TButton itself... 
> Does anybody know a simple way to clear and update a TCanvas by pressing a
> button situated inside this canvas, without making ROOT angry??
> Thanks a lot,
> Stephane
> student at Fermilab/CDF for the UC Davis.
> 



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