Class TextRadioButton

A radio button with text.

Extends RadioButton, so all fields of RadioButton are inherited.

Usage:

     -- Create a group of buttons that print when they are selected.
     local group = Panel(0, 0)
     local numButtons = 10
     for i = 1, numButtons, 1 do
       local button = TextRadioButton(0, i * 20, 60, 16, "Button " .. i)
       button:addListener("selected", function(t, k, old, new)
         if new then
           print(t.text .. " was selected")
         end
       end)
       group:add(button)
     end

Fields

TextRadioButton.text The text of the button.
TextRadioButton.textPadding The padding between the text and the button edge.

Constructor

TextRadioButton:_init (x, y, width, height, text) Constructs a new TextRadioButton.


Fields

TextRadioButton.text
The text of the button.
TextRadioButton.textPadding
The padding between the text and the button edge.

Constructor

TextRadioButton:_init (x, y, width, height, text)
Constructs a new TextRadioButton.

Parameters:

  • x The x coordinate of the new component, relative to its parent.
  • y The y coordinate of the new component, relative to its parent.
  • width The width of the new component.
  • height The height of the new component.
  • text The text of this radio button.
generated by LDoc 1.4.3 Last updated 2015-02-10 07:20:59