britzl / gooey

Defold GUI system
MIT License
150 stars 22 forks source link

Missing return checkbox instance in set_checked or set_visible #61

Closed MinchukSergei closed 3 years ago

MinchukSergei commented 3 years ago

From example:

STATE

It is possible to set the state of a checkbox. This is good for setting the initial state of the checkbox:

update_checkbox(gooey.checkbox("checkbox/bg").set_checked(true)) update_checkbox(gooey.checkbox("checkbox/bg").set_visible(false))

but is not available right now. We should return instance to make it work.

It seems we should modify core.instance method:

for name,fn in pairs(functions or {}) do
    data[name] = function(...)
        fn(data, ...)
        +++
        return data
        +++
    end
end
britzl commented 3 years ago

Thank you for reporting this!