#How to make dynamically generated widgets in lua?
1 messages · Page 1 of 1 (latest)
found it out, i will post the createcode for this thing:
-- Function to create widgets
function createWidgets(parentName, numWidgets)
-- Loop to create the specified number of widgets
for i = 1, numWidgets do
-- Create a label element and set its text
local labelName = parentName .. ".label" .. i
widget.addChild(parentName, {
type = "label",
value = " TestModule " .. i,
zlevel = 4,
fontSize = 15,
position = {0, 30*-i}
}, labelName)
end
end