RE: how to get the active button in a GList



On 2001.02.01 17:07:43 +0100 "Dugas, Alan" wrote:
> Connect a signal handler to each button via;
> 
> gtk_signal_connect(GTK_OBJECT(radio_button), "clicked",
> GTK_SIGNAL_FUNC(check_if_active_button), NULL);
> 
> Then within the callback put the following "if" conditional;
> 
> void check_if_active_button ( GtkWidget button, gpointer user_data )
> {
> 	if ( GTK_TOGGLE_BUTTON(button)->active )
> 	{
> 	/* perform action here */
> 	}
> }
>

Hmm..... well, the thing is, I have really a LOT of buttons. And the action
should take place when another button outside this group is pressed. So
this would mean I´d have to declare all buttons globally and write a LOT of
action-methods. I was actually hoping to do it easier by only making the
groups global and select the active button from that, that would save me a
lot of time...

But if that´s not possible, I´ll stick to this method.

Ronald Bultje





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]