Hello. David.
My answer is not the ready-to-consume, I am begging a pardon.
In C++ one can alter the behavior of any class in question by
deriving his/her own class from that and overloading the methods
of his/her choice.
For this particular case of may create your own
class TSmartCanvas : public TCanvas {
public:
TSmartCanvas() : TCanvas(){}
. . .
~TSmartCanvas(){ <do in here waht ever you want to be done
when the object is to be destroyed by any
reason > ;}
}
providing our own destructor. That will be called just the object
TSmartCanvas is deleted (for example the window it created has been destroyed).
Hope this helps,
Valery
----- Original Message -----
From: David Faden <dfaden@iastate.edu>
To: <roottalk@pcroot.cern.ch>
Sent: 27 октября 2000 г. 17:36
Subject: [ROOT] attaching action to window close
> Hi,
> Is there a way to specify a chunk of code to be executed when
> a TCanvas (or GUI window) is closed? Is it possible to do this under
> interpretted code without blocking without polling -- something akin to
> TPad::AddExec(char*, char*)?
> Does the number returned by TCanvas::GetCanvasID() have any utitility
> if the TCanvas is not embedded?
> Thank you.
>
> David
>
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:36 MET