View Single Post
06/11/14, 03:53 AM   #18
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
3. Lua's pass-by-reference does interesting things that let you work around the absence of a one-by-one add API...

Turns out the following code will actually create the header in LAM because tables are passed around as references:
Lua Code:
  1. -- ...
  2. local optionsTable = {}
  3. LAM:RegisterOptionControls("Foo", optionsTable)
  4. table.insert(optionsTable, {
  5.     type = "header",
  6.     name = "Bar"
  7. })
  8. -- ...