Re: Gtk::RadioButton??!!
- From: Bob Caryl <bob fis-cal com>
- To: Jamiil <jalqadir netscape net>
- Cc: Gtkmm List <gtkmm-list gnome org>
- Subject: Re: Gtk::RadioButton??!!
- Date: Tue, 06 Dec 2005 08:22:47 -0600
The primary thing you seem to be missing in your code is a
Gtk::RadioButtonGroup that is required when you create your radio buttons.
See docs:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1RadioButtonGroup.html
Bob
Jamiil wrote:
> The thinng is that I am doing that, but the window is still displayed
> with all the radio buttons turned on.
>
> What am I doing wrong!!?
>
> OS: WIN32
> GTKmm = 2.4.x
> class MyClass : virutual public Gtk::Frame{
> ...
> Gtk::RadioButton* rbMr;
> Gtk::RadioButton* rbMiss;
> Gtk::RadioButton* rbMss;
> Gtk::RadioButton* rbNone;
> Gtk::HBox* hboxGender;
> Gtk::VBox* vbox2_2;
> .....
> };
> MyClass::MyClass(){
> rbMr = manage(new Gtk::RadioButton("Mr"));
> rbMiss = manage(new Gtk::RadioButton("Mrs"));
> rbMss = manage(new Gtk::RadioButton("Ms"));
> rbNone = manage(new Gtk::RadioButton("None"));
> hboxGender = manage(new Gtk::HBox());
> vbox2_2 = manage(new Gtk::VBox());
>
>
>
> rbMr->set_active(true);
> rbMiss->set_active(false);
> rbMss->set_active(false);
> rbNone->set_active(false);
> ......
> hboxGender->pack_start(*rbMr, Gtk::PACK_SHRINK,5);
> hboxGender->pack_start(*rbMiss, Gtk::PACK_SHRINK,5);
> hboxGender->pack_start(*rbMss, Gtk::PACK_SHRINK,5);
> hboxGender->pack_start(*rbNone, Gtk::PACK_SHRINK,5);
> ......
> vbox2_2->pack_start(*hboxGender, Gtk::PACK_EXPAND_WIDGET);
> .....
> }
>
> Thanks in advance!!
> Bob Caryl escribió:
>
>> Use the Gtk::RadioButton::set_active method with a TRUE parameter to
>> display selected, and a FALSE parameter to display it unselected.
>>
>> Jamiil wrote:
>>
>>
>>
>>> Hi folks!
>>> I have a few Gtk::RadioButton in my application which when displayed
>>> are active, but I want'em to displayed inactive. How can I make this
>>> radio buttons first display unselected and then, when the user makes
>>> the selection, appear selected.
>>>
>>> TIA
>>>
>>>
>>>
>>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]