>>101532923
>And how do the callbacks connect to the elements in the json ?
Oh and to answer this question, you can see in the Lua code that I can basically fetch objects and assign Lua table properties, so basically I have a root Widget * (actually a smart pointer), that has children, who also have children and so on, then I have a find method that returns that, then you can assign a Lua table property that the C++ code will look for, so then UICheckBox::setChecked just does this:
if (hasLuaField(*this, "onCheckChange")) {
callLuaField(*this, "onCheckChange", checked);
}
So if you do:
window:findCheckBox('foo').onCheckChange = function()
print('checked!')
The C++ part will find that property in its own Lua object and call it.