State changing of Toggle Buttons

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

State changing of Toggle Buttons

Michal Porzuczek
Hi,

I was wondering if it is possible to set a Toggle Button's state to
something else when you are inside another Toogle Button's callback. I
know there is the gtk_toggle_button_set_active method but that
requires you to have the GtkToggleButton. Is there another method that
only uses the Widget to change its state? Or is there an easy way of
accessing the GtkToggleButton from the Widget?

Thanks in advance

Michal
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: State changing of Toggle Buttons

Peter Bloomfield
On 05/30/2005 04:44:00 PM, Michal Porzuczek wrote:
> Hi,
>
> I was wondering if it is possible to set a Toggle Button's  
> state to something else when you are inside another Toogle  
> Button's callback. I know there is the  
> gtk_toggle_button_set_active method but that requires you to  
> have the GtkToggleButton. Is there another method that only  
> uses the Widget to change its state? Or is there an easy way of  
> accessing the GtkToggleButton from the Widget?

GTK_TOGGLE_BUTTON(widget)
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: State changing of Toggle Buttons

Eduardo M KALINOWSKI
In reply to this post by Michal Porzuczek
Michal Porzuczek wrote:

>Hi,
>
>I was wondering if it is possible to set a Toggle Button's state to
>something else when you are inside another Toogle Button's callback. I
>know there is the gtk_toggle_button_set_active method but that
>requires you to have the GtkToggleButton. Is there another method that
>only uses the Widget to change its state? Or is there an easy way of
>accessing the GtkToggleButton from the Widget?
>
>  
>
You can pass the other toggle button as the user_data argument to the
callback:
g_signal_connect(G_OBJECT(toggle1), "toggled", G_CALLBACK(my_func),
toggle2);

You can use g_object_set_data to store a pointer to the other toggle in
the first toggle object, and the retrieve the pointer with
g_object_get_data.

If you use glade, you can use its widget looking functions.

--
<Deek> Yes, America is a country based on how pissed-off a group of taxed
       people can get.
<Deek> We exist as a country because we're cheap.

Eduardo M KALINOWSKI
[hidden email]
http://move.to/hpkb

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list