Hello,
I have a macro that generates a TLegend object on a canvas. The legend is stored as part of a larger class, and the class function to draw the legend is:
void SingleHistList::AddLegend(Float_t LowLeftX, Float_t LowLeftY, Float_t UpRightX, Float_t UpRightY)
{
_Leg = new TLegend(LowLeftX, LowLeftY, UpRightX, UpRightY);
_Leg->SetFillColor(kWhite);
for (Int_t i=0; i<_NHist; i++)
{
_Leg->AddEntry(_Hists[i]->GetHist(), _Hists[i]->GetLegEntry());
}
_Leg->Draw();
}
When I call this function multiple times to resize the legend, the previous legend is not removed, so I end up with multiple boxes on the histogram. I have tried the Clear command, but this only removes the entry, not the TPave box itself. How can I remove this box?
Thanks very much,
Adrian