View Single Post
Old 07-22-2017, 02:22 PM   #25
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by Flaneurette View Post
Lokasenna,

Is it possible to dump an (multidimensional) array/table inside a menu? would be cool. As I can see, it's only string right now.
It would much easier to do on your end than to build it into the GUI class, since I can't know what dimensions and indexing are being used for a user's table.

For the table listed above, you could do something like this (code might not be 100% correct, can't check it right now):

Code:
local function GetMenuItems()

  local str = ""

  for i = 1, #MyArray - 1 do
    str = str..MyArray[i][1]..","
  end

  -- This avoids an extra , at the end of the string
  str = str..MyArray[#MyArray][1]

  return str
end

...

GUI.New("my_mnu", "Menubox", 3, 256, 176, 64, 20, "Options:", GetMenuItems())
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote