How to disable the default selection of a radio button?

Discussion in 'Ruby' started by Li Chen, Jan 10, 2009.

  1. Li Chen

    Li Chen Guest

    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-forum.com/.
     
    Li Chen, Jan 10, 2009
    #1
    1. Advertising

  2. Li Chen

    Lyle Johnson Guest

    On Sat, Jan 10, 2009 at 2:51 PM, Li Chen <> 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 Johnson, Jan 12, 2009
    #2
    1. Advertising

  3. Li Chen

    Li Chen Guest

    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-forum.com/.
     
    Li Chen, Jan 12, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TVIuIFVOREVSSElMTA==?=

    Radio button exclusive selection for DataGrid

    =?Utf-8?B?TVIuIFVOREVSSElMTA==?=, May 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,204
    Steve C. Orr [MVP, MCSD]
    May 18, 2004
  2. Bill via DotNetMonster.com

    Force a radio button selection

    Bill via DotNetMonster.com, Mar 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    534
    Bill via DotNetMonster.com
    Mar 11, 2005
  3. Mark
    Replies:
    24
    Views:
    1,180
    Ed Jay
    Jan 7, 2006
  4. Chris Marsh

    Radio button selection and a data grid

    Chris Marsh, Apr 6, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    421
    Ben Rush
    Apr 7, 2007
  5. Hiten
    Replies:
    1
    Views:
    626
    Vidar Petursson
    May 26, 2004
Loading...

Share This Page