On a complete side note (and not the cause of this issue)… you pass in the two tables as parameters for each insert. It probably would be better code wise to pass in the actual image and such, perhaps something like:
for i = 1, #butTable, 1 do local isCategory = false local rowHeight = 65 local rowColor = { default={ 1, 1, 1 }, over={ 0.15, 0.4, 0.729, 0.2 } } local lineColor = { 0.15, 0.4, 0.729 } menuList:insertRow( { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, params = { button = butTable[i], label = labelTable[i] } } ) end
then in your onRowRender() function you don’t have to look up the items in the table there. This is just semantics but each insert inserts one row, that row should have the values for that row be the parameters. If you just want to use the row’s index to look up the values, you don’t need to pass the values in via parameters at all. Just define the table values at the top of the scene.
Rob