[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to disable the default selection of a radio button?

Li Chen

1/10/2009 8:52:00 PM

Hi all,

I use FXRuby to create 5 radio buttons and tie them to FXDataTarget.
When I run the codes a defautl button is always selected. Is it
possible to disable this feature so that no button is chosen at the
first run?

Thanks,

Li
--
Posted via http://www.ruby-....

2 Answers

Lyle Johnson

1/12/2009 3:47:00 PM

0

On Sat, Jan 10, 2009 at 2:51 PM, Li Chen <chen_li3@yahoo.com> wrote:

> I use FXRuby to create 5 radio buttons and tie them to FXDataTarget.
> When I run the codes a defautl button is always selected. Is it
> possible to disable this feature so that no button is chosen at the
> first run?

Sure, just initialize the FXDataTarget to some value that doesn't
correspond to *any* of the radio buttons, e.g.

data_target = FXDataTarget.new(-1)
FXRadioButton.new(..., :target => data_target, :selector =>
FXDataTarget::ID_OPTION+0, ...)
FXRadioButton.new(..., :target => data_target, :selector =>
FXDataTarget::ID_OPTION+1, ...)
FXRadioButton.new(..., :target => data_target, :selector =>
FXDataTarget::ID_OPTION+2, ...)
FXRadioButton.new(..., :target => data_target, :selector =>
FXDataTarget::ID_OPTION+3, ...)
FXRadioButton.new(..., :target => data_target, :selector =>
FXDataTarget::ID_OPTION+4, ...)

Hope this helps,

Lyle

Li Chen

1/12/2009 11:10:00 PM

0

Lyle Johnson wrote:

>
> Sure, just initialize the FXDataTarget to some value that doesn't
> correspond to *any* of the radio buttons, e.g.

Thanks. But where can I find this tip in its API?

Li
--
Posted via http://www.ruby-....