TPad::Divide

From: Thomas Bretz <tbretz_at_astro.uni-wuerzburg.de>
Date: Tue, 04 Jan 2005 17:42:38 +0100


Dear all,

there is something I don't understand.

Assume I have created a TCanvas c. I have divided the canvas in two subpads p1 and p2 and these are divided into p11, p12, p21 and p22 using c.Divide(). Now I Draw an object in two different looks (eg Draw("option1"), Draw("option2")) to p11 and p22. Because I don't want to have the owenership of the object I call SetBit(kCanDelete) for it.

If I now delete the canvas something - in my opinion - strange happens. Because the two subpads are not in gROOT->GetListOfCleanups() it seems that under some circumstances (which I cannot resolve) p11 _and_ p22 are trying to delete my object and I get a crash. On the other hand the Canvas containing the objects are in the ListOfCleanups and each of the object - when deleted - should call recursiveRemove which should - in all of its subpads - remove the object from all ListOfPrimitves.

Simply adding p1 and p2 to the ListOfCleanups solves the Problem. Does somebody have any idea what may go on?

There is only one thing else which might be important: The object (in its Draw function) calls  

gPad->GetCanvas()->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", "MyClass", this, "EventInfo(Int_t,Int_t,Int_t,TObject*)");

I disconnect the Signal in the destructor.

Best regards,
Thomas. Received on Tue Jan 04 2005 - 17:43:35 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET