pkulchenko / wxlua

wxlua: Lua bindings for wxWidgets cross-platform GUI toolkit; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and wxWidgets 3.x
304 stars 59 forks source link

Use type-safe event definition macros for Bind() compatibility. #81

Closed solemnwarning closed 3 years ago

pkulchenko commented 3 years ago

@solemnwarning, thank you for the patch! Any details/examples on why this may be needed?

solemnwarning commented 3 years ago

Its needed for handling the wxLua events with Bind(), for example my current prototype:

wxEvtHandler *eh = new wxEvtHandler;

eh->Bind(wxEVT_LUA_ERROR, [&](wxLuaEvent &event)
{
    fprintf(stderr, "wxEVT_LUA_ERROR: %s\n", event.GetString().mb_str().data());
    return;
});

wxLuaState s(eh);