And that's why I shouldn't write code in a text editor where I can't check if it's correct... :/ Sorry.
Quote:
Originally Posted by babag
inelegant, i'm sure but it seems to put things in the right place. i had a lot of trouble getting that to happen.
|
You can use a similar idea to how it calculates
y to get
x. Try:
Code:
GUI.New(
"btn_"..k,
"Button",
1,
((k - 1) % buttons_per_row) * button_width, -- x
math.floor((k - 1) / buttons_per_row) * button_height, -- y
button_width, -- w
button_height, -- h
v.label,
function() reaper.Main_OnCommand(v.command, 0) end
)