Skip to main content

Dialog:add()

Adds a question, a piece of text or a container to the dialog. They show in the order you add them.

Signature​

Dialog:add(view: TextView | CheckBox | EditText | NumberInput | Slider | RadioGroup | TapPicker | TapListPicker | GestureRecorder | Row | Column | Section | Page): void

Returns

void

Example​

Dialog:init()
Dialog:add(TextView("Choose how the macro runs"))
Dialog:add(CheckBox(1, "Collect daily rewards", true))
Dialog:add(NumberInput(2, "Runs", 10))
Dialog:show()

Notes​

  • Call Dialog:init() first.
  • Containers (Page, Section, Row, Column) are filled with their own add() and then added here.
  • Once you add a Page, everything must go inside pages; adding anything else to the dialog is an error.
  • An empty Row() or Column() added here takes every item added after it.
  • Every question needs its own id. Two new questions (NumberInput, Slider and the pickers) with the same id stop the dialog with an error when it is shown.