How to disable the default selection of a radio button?

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

On Sat, Jan 10, 2009 at 2:51 PM, Li Chen [email protected] 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

Lyle J. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs