How to disable the default selection of a radio button?

L

Li Chen

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
 
L

Lyle Johnson

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
 
L

Li Chen

Lyle said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top