Re: [ROOT] Got those SetEditable() blues again....

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Jan 30 2002 - 08:13:42 MET


Hi Brett,

When the pad is declared to be non-editable
 - you cannot modify the contents of the pad with the mouse
 - you cannot add new objects.

The second condition was not indicated in the doc. It is now.

In your case, simply call SetEditable(kFALSE) once you have added all your
primitives.

Rene Brun

Brett Viren wrote:
> 
> This gives me deja vu all over again, but I can't find this in the
> email archives.
> 
> What exactly does the TPad:fEditable flag mean?
> 
> The comments in the code (TPad::SetEditable) say, when true, it keeps
> the user from interactively (via the mouse) moving things around in
> the TPad.  This it does, however, it also stops non-interactive
> things, such as TObject::AppendPad().
> 
> What other methods does it block?
> 
> My use case is I want to build a TCanvas full of several TPads.  I
> don't want the users to be able to interactively move the TPads around
> in the TCanvas, but I want to still be able to add objects into the
> TPads (from code, not via the mouse).  These objects should also not
> be interactively movable.
> 
> How can I do this?
> 
> Do I have to wrap all calls which touch the TPad with
> SetEditable(true)/SetEditable(false).  If so, which ones?  It isn't
> always obvious.  This would be very painful, particularly since
> methods silently fail when blocked.
> 
> The alternative seems to be letting the TCanvas and child TPads be
> fully editable, which is fine until that one mistaken click-drag
> event rearranges the display.
> 
> Any guidance is appreciated,
> -Brett.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:40 MET