Re: Question about TPaveText

From: Melinda Siciliano <mellybinda_at_gmail.com>
Date: Wed, 19 Oct 2011 10:38:50 +0200


Hi Olivier,

I can make a schema of the problem

I have an histogram that is filled in a while loop. During every while loop some tests on the histograms are performed and the output of these tests is written on a tpavetext and plotted on a canvas. drawing the histogram in the next cycle I clear the canvas and I plot the histogram and the TPaveText again. While the histogram is redrawed, the TPaveText is drawn one on top of the other. This means that the Clear() method has no effect on the TPaveText..

Any suggestion on that?

Cheers,

Melinda

On Tue, Oct 18, 2011 at 4:33 PM, Olivier Couet <Olivier.Couet_at_cern.ch>wrote:

> Can you provide a small example reproducing your problem ?
>
> On Oct 16, 2011, at 12:32 PM, Melinda Siciliano wrote:
>
>
>
> -Dear ROOTers,
>
> I have to fill an histogram (TH1 or TH2) and draw it with a TPaveText in
> which I write a message. I draw it in a TCanvas object and then I fill it
> again and I draw it a second time in the same canvas. Before drawing the
> canvas and the TPaveText again, I clear the canvas and I draw the histogram
> and the TPaveText again. I would like the that the TPaveText object present
> in the canvas is only one. The problem is that even when I clear the canvas
> and the histogram, I have that the TPaveText is not deleted and the
> following tpavetext are drawn one on the other.
>
> How can I delete from the canvas the other TPaveText objects? is this
> object related to the histogram? In this case, if I reset the histogram, is
> the TPaveText deleted? Have I to delete explicetly the TPaveText before
> drawing again the histogram?
>
> Cheers,
>
> Melinda
>
>
>
Received on Wed Oct 19 2011 - 10:39:17 CEST

This archive was generated by hypermail 2.2.0 : Mon Oct 24 2011 - 17:50:01 CEST