[ubuntu-in] GTK+ RadioButton Signal Handler issue

Anil Vishnoi vishnoianil at gmail.com
Mon Mar 22 15:45:49 GMT 2010


Well folks,
    Its my silly mistake,i registered two signal handler to the same 
radion button,check the below code snippet

button = gtk_radio_button_new_with_label(NULL,"Radio1");
   gtk_box_pack_start(GTK_BOX(hbox),button,FALSE,FALSE,0);
   
g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(radio1signalhandler),NULL);  
<<< radio1signalhandler attached to "button"
   gtk_widget_show(button);

   group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button));
   button2 = gtk_radio_button_new_with_label(group,"Radio2");
   gtk_box_pack_start(GTK_BOX(hbox),button2,FALSE,FALSE,0);
   
g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(radio2signalhandler),NULL);  
<< radio1signalhandler attached to "button" again.
   gtk_widget_show(button2); 

And the logic of both signal handler is kind of same if you see the 
whole source code.Thats the reason i was getting wrong output.Its just 
my silly mistake.

Thanks
Anil
Manish Sinha wrote:
>
>
> On Sun, Mar 21, 2010 at 5:37 PM, Anil Vishnoi <vishnoianil at gmail.com 
> <mailto:vishnoianil at gmail.com>> wrote:
>
>     Folks,
>        Ignore this mail.I got the bug.My bad!!
>
>
> So please share the root of problem and the solution you got.
>
> Reason: Mailing lists mails are publicly archived and are searchable 
> by search engines.
> Your solution can save the time of some poor soul who is facing this issue




More information about the ubuntu-in mailing list