[ROOT] TCanvas behavior inside a GUI

From: Glen R. Salo (gsalo@mrcstl.com)
Date: Fri Oct 05 2001 - 20:04:48 MEST


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:02 MET