Re: [ROOT] TGButton SetCommand query

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Tue Apr 23 2002 - 18:03:18 MEST


Hi Paul,

   yes PlotMe must know the embedded canvas, so you must pass it or set
it as a PlotMe class member.

-- Fons



On Tue, 2002-04-23 at 17:57, Paul Dixon wrote:
> Hello Fons,
> 
> >    many small problems. All fixed in the attached tar file.
> > 
> Many thanks for your response... it's just what I wanted. Perhaps I can
> trouble you for one more question...
> 
> When I click the PlotMe button, the canvas isn't updated - is the only way
> to do this to pass a pointer to the TRootEmbeddedCanvas into PlotMe::Sinx
> and then use this pointer as follows:
> 
>    TCanvas *c1 = c->GetCanvas();
>    c1->Update();
> 
> Cheers,
> 					Paul
> 
> 
> > 1) you must define the gPlotMe in the PlotMe.cxx file (in the header you
> >    only have the declaration
> > 2) gPlotMe if you want to access it via the interpreter must be declared
> >    in the LinkDef.h as a global symbol
> > 3) the TF1 was going out of scope at the end of Sinx() so nothing was
> >    drawn
> > 4) in the modified canvasgui.cxx I also show how to better use
> >    signal/slots to connect the button action to PlotMe::Sinx() in which
> >    case you don't need to global gPlotMe.
> > 
> > 
-- 
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 7679480



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:51 MET