Re: [ROOT] TGCombo connection

From: Ilka Antcheva (Ilka.Antcheva@cern.ch)
Date: Sat Dec 11 2004 - 10:10:27 MET


Hi Paolo,
It is because you have

TGButton* btn = (TGButton*) gQTSender;

in your DoCombo method. Remove two first lines in the method and
check the id directly.

Cheers, Ilka

Paolo MAESTRO wrote:

>Hi Rooters,
>in a GUI application I would like to associate to a TGCombo
>the action of the method DoCombo.
>
>I created a TGComboBox object
>
>fBox = new TGComboBox(f1, M_COMBO);
>
>and its connection to the method DoCombo with
>
>fBox->Connect("Selected( Int_t)","TGMyGui",this, "DoCombo(Int_t)");
>
>The method is defined as
>void TGMyGui::DoCombo(Int_t id)
>{
>TGButton* btn = (TGButton*) gQTSender;
>id = btn->WidgetId();
>
>if(id==M_COMBO)
>  printf("id=M_COMBO");
>
>}
>
>Every time I select an entry of the combo box, the method DoRadio
>is entered, but id is always different from M_COMBO . Why?
>Where am I mistaken?
>
>Thanks 
>  Paolo
>
>
>
>  
>



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET