Re: [ROOT] TGMainFrame

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Wed Feb 07 2001 - 17:17:12 MET


Hi Thomas,

   after creating the button you have to add it to the TGMainFrame
using: TGCompositeFrame::AddFrame() method. Later it will then be
deleted in the TGCompsiteFrame dtor.

To keep track of the button make the pointer a member of your class.

Cheers, Fons.


Thomas Bretz wrote:
> 
> Hello,
> 
> I created a class derived from TGMainFrame.
> 
> In the constructor I create a button on top of the frame with something
> like:
> TGTextButton *but=new TGTextButton(this, "text", 555);
> but ->MoveResize(13, 13, 13, 13);
> 
> If I understood it right it is added to a list and deleted inside a
> destructor (TGCLient?)
> 
> In the ProcessMessage function of my class I need the pointer (eg to
> disable the button). I would like do do something like:
> TGTextButton *button=(TGTextButton*)GetResourcePointerById(555); // 555
> is the id of the button, see above
> 
> Is this possible?
> 
> Thankd,
> Thomas.

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:35 MET