Re: RadioButton Groups



On Wed, 2007-01-10 at 10:40 -0600, Nik Ogura wrote:
I have a group of RadioButtons, and I want the program to do something
useful with them when they are pressed, changed, etc. 

How do I :

a) set a signal_connect for the group to respond to something being
toggled/changed (or do I have to set it individually for each button?)

you have to set it for every widget.  just use the same callback
function and check whether the widget invoking the callback is checked
or not (see below), if you don't want to use a separate function for
each radio button.

b) get which button is active in the group so that I can do something
useful with the value.

since Gtk2::RadioButton is a Gtk2::ToggleButton, just use the
get_active() method on the radio button.

  $is_toggled = $radio->get_active();

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,  E: ebassi gmail com
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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