Today I tried to import a window created with RTBuilder into another file. But I can't access the widgets/controls.
In the MainWindow.lua file, the RTBuilder generated this statment on the end:
return Window, { ['Button1'] = Button1, ['Checkbox1'] = Checkbox1, }
I used the following import statement:
local win, wid = require("MainWindow")
=> this is the file build with RTBuilder - MainWindow.lua
When I print the variables, I get the following:
Window: 000002184A808850
.\MainWindow.lua
I think the RTBuilder has to add the widget table to the window object, like:
Window.widgets = { ['Button1'] = Button1, ['Checkbox1'] = Checkbox1, }
Then I can access the properies of each widget by the following statement:
win.widgets.Button1.text = "OK"
Can you check this or explain how the window file should be imported into another file.