Since radio buttons and checkboxes are also all over the web, I
figured it was time to add them to Shoes.  This brings the set of
native controls to seven: edit_line, edit_box, button, list_box,
progress, check and radio.

I haven't got all the bugs cured, but here's sort of what's going
on...

To do the typical checkbox with a line of text, use a flow:

  stack do
    flow { check; para "I am a doctor" }
    flow { check; para "I am a nurse practitioner" }
  end

Or, a bit more lightweight, I'd recommend:

  flow do
    check; para "I am a doctor\n"
    check; para "I am a nurse practitioner\n"
  end

Radio buttons are all grouped together in a stack or flow.  So to
make different groups, separate them into different slots.

  flow do
    subtitle "I like:\n"
    radio; para "vans\n"
    radio; para "castles\n"
    radio; para "pools\n"
  end
  flow do
    subtitle "Paging:\n"
    radio; para "Donald Sutherland\n"
    radio; para "Nicholas Cage\n"
    radio; para "Cherry Casanova\n"
  end

Every radio and check has a `checked?` method which gives back true
or false.  You can also assign a block which is called whenever the
element's check is changed.

  @c = check { alert("CHECKED: [EMAIL PROTECTED]") }

_why

Reply via email to