Radiobutton.checked read/write property


Set or check wether the Radiobutton item is selected.

  • A Radiobutton is always used in groups, grouped by their parent object.
  • Radiobuttons are exclusive in the same group : selecting one deselects the others.

Example

local ui = require "ui" -- create a Choice object from Radiobutton local Choice = Object(ui.Radiobutton) -- Choice onClick event function Choice:onClick() self.checked = true self.parent:status("Your choice : "..self.text) end -- create a simple window local win = ui.Window("Radiobutton.y sample", 200, 100) Choice(win, "Choice 1", 66, 15):onClick() Choice(win, "Choice 2", 66, 40) -- shows the window win:show() -- update user interface repeat ui.update() until not win.visible