Re: [ROOT] Clipping TPad objects.

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Mar 02 2002 - 05:30:26 MET


Hi Brett,

Use the pad ClipFrame facility.
See examples in TGraph.cxx. Seatrch for 
 SetBit(kClipFrame);
 gPad->ResetBit(kClipFrame);

Rene Brun

On Fri, 1 Mar 2002, Brett Viren wrote:

> Hi,
> 
> I have a TPad derived class which holds 4 TGaxis, one on each TPad
> edge, with a central region where other objects are drawn.  I manage
> zooming and ranges similar to TGHistPainter such that the central
> region's range is always the actual desired one (again, stealing much
> from THistPainter).
> 
> The problem I am up against is that after a zoom, objects protrude out
> of the central region and into the TGaxis border region.
> 
> Is there some mechanism to clip all these TPad objects (except for the
> TGaxis) such that they are not drawn outside the central region?  How
> is this accomplished with THistPainter and histograms?
> 
> One solution I see is to implement the central region as its own TPad,
> as a TPad clips objects to its boundary, but that would require
> substantial reworking and I wanted to see if there is a simple way
> first.
> 
> As always, thanks,
> -Brett.
> 



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