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
306 stars 59 forks source link

Add metatable entries for classes with operator overload methods. #135

Open solemnwarning opened 7 months ago

solemnwarning commented 7 months ago

You can declare operator overloads in a class and genwxbind.lua will generate methods for them that can be called from Lua (e.g. obj:op_add(other_obj)), this commit adds them to the class metatable too, so they can be invoked using Lua operators (e.g. obj + other_obj).