PDA

View Full Version : [SOLVED] gtkmm - disable radio button



tbastian
March 13th, 2010, 04:33 PM
I have a (hopefully) really simple question.

How do you disable radio buttons (ie gray them out) using gtkmm? I've searched the API and I can't find any obvious way of doing this...

Is it even possible?

SledgeHammer_999
March 13th, 2010, 07:46 PM
Gtk::RadioButton (http://library.gnome.org/devel/gtkmm/unstable/classGtk_1_1RadioButton.html) derives from Gtk::Widget (http://library.gnome.org/devel/gtkmm/unstable/classGtk_1_1Widget.html) (see class hierarchy on the top of the page).

All you have to do is call Gtk::Widget::set_sensitive(). (http://library.gnome.org/devel/gtkmm/unstable/classGtk_1_1Widget.html#a3192b5f7f4c15876169b913eb 9d1075e) Eg:


.....
Gtk::RadioButton my_radio_button;
my_radio_button.set_sensitive(false);
....

tbastian
March 16th, 2010, 12:27 AM
thanks! I'll give that a try and let you know how it turns out.

tbastian
March 16th, 2010, 01:33 PM
that worked out great, thanks again!

SledgeHammer_999
March 16th, 2010, 01:51 PM
no problem.