-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
I have a callback that get's bound in lua and from c++ I'd like to invoke that, but self is always nil and I am not sure how to access self as the lua table, not the Client* C++ object...
local client = require 'client'
local view = {}
function view:onConnect()
self.connected = true
end
function view:create()
client:onConnect(self.onConnect)
endm["Client"].setClass(
UserdataMetatable<Client>()
.addStaticFunction("onConnect", [](Client* self, const std::function<void(void)>& connectFn)
{
connectFn();
})
);Is this possible with kaguya?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels