LuaSTG-x Core API
|
Public Member Functions | |
function | free () |
function | set (local func) |
The C types for callbacks have some extra methods
function free | ( | ) |
Free the resources associated with a callback. The associated Lua function is unanchored and may be garbage collected. The callback function pointer is no longer valid and must not be called anymore (it may be reused by a subsequently created callback).
Associate a new Lua function with a callback. The C type of the callback and the callback function pointer are unchanged.
This method is useful to dynamically switch the receiver of callbacks without creating a new callback each time and registering it again (e.g. with a GUI library).