Re: State changing of Toggle Buttons



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
ekalin bol com br
http://move.to/hpkb




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