Re: [ROOT] TCanvas behavior inside a GUI

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Oct 23 2001 - 11:23:41 MEST


Hi Glen,

I have modified the TH1::Draw and TGraph::Draw to automatically create
a new canvas in case the current pad is not editable. This should fix the
special case you are are reporting with the treeViewer.
The fix is now in CVS.

Rene Brun

Glen R. Salo wrote:
> 
> Hi ROOTERS,
> 
> I have developed a GUI with several TGCanvas's and TRootEmbeddedCanvas's.
> I wish to keep the user from drawing in these canvases with the
> TBrowser or TTree viewer.  I have removed the TCanvas's from
> gROOT->GetListOfCanvases(), but this does not keep the TBrowser or TTree
> viewer from drawing onto the TGCanvas and TRootEmbeddedCanvas's.  If I set
> TCanvas::SetEditable(kFALSE) on each canvas, I get a segmentation
> violation when I try to draw from the TTree viewer whereas I expected a
> new TCanvas (separate from the GUI) to automatically popup.  To avoid this
> problem, I must create an active canvas outside the GUI.  Is there a
> way I can prevent the canvases inside the GUI from being drawn to by the
> TBrowser and TTree viewer and have the TBrowser and TTree viewer
> automatically create a canvas if needed (i.e., only in cases where there is
> not already an active canvas outside the GUI)?
> 
> Thanks for your help,
> 
> Glen



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