Re: connecting signals & slots

From: Bertrand Bellenot <bertrand.bellenot_at_cern.ch>
Date: Sun, 28 Jan 2007 19:03:51 +0100


Hi Roger,

Just replace:

fFitButton = new MyFitButton(fHframe2, (TGHotString*)"&Fit");

by:

fFitButton = new MyFitButton(fHframe2, new TGHotString("&Fit"));

Cheers,
Bertrand.

Roger Mason wrote:
> Hi Valeri,
>
> "Fine, Valeri" <fine_at_bnl.gov> writes:
>
>
>> I seems to me I have to re-post the portion of my C++ example:
>>
>> public:
>> MyFitButton(const TGWindow *p, TGHotString *s, Int_t id=-1
>> , GContext_t norm =GetDefaultGC()()
>> , FontStruct_t font=GetDefaultFontStruct()
>> , UInt_t option = kRaisedFrame|kDoubleBorder)
>> : TGTextButton (p, s, id, norm, font, options )
>> , fGraph(0), fF1(0) {}
>>
>>
>
> I now have:
>
> class MyFitButton : public TGTextButton {
> private:
> TGraph *fGraph;
> TF1 *fF1;
>
> public:
> MyFitButton(const TGWindow *p, TGHotString *s)
> : TGTextButton (p, s )
> , fGraph(0), fF1(0) {}
>
> void SetGraph(TGraph *g) { fGraph = g;}
> void SetFun1(TF1 *f) { fF1 = f;}
>
> TGraph *Graph() const {return fGraph;}
> TF1 *Fun1() const { return fF1;}
>
> ClassDef(MyFitButton,1);
> };
>
> .x RogersGUI.C++
>
> segfaults if the following line is uncommented:
>
> fFitButton = new MyFitButton(fHframe2, (TGHotString*)"&Fit");
>
> Cheers,
> Roger
>
>
Received on Sun Jan 28 2007 - 19:03:57 CET

This archive was generated by hypermail 2.2.0 : Mon Jan 29 2007 - 05:50:00 CET