Module gtk_internal.callback

Handle callbacks from Gtk to Lua.

Functions

local _callback (data, ...) Handler for Gtk signal callbacks.
local _callback_return_value (L, return_type, cbi) Handle return values from the Lua handler to pass back to Gtk.
local _free_callback_info (data, closure) Free memory on signal handler disconnection.


Functions

local _callback (data, ...)
Handler for Gtk signal callbacks. Find the proper Lua callback, build the parameters, call, and optionally return something to Gtk. This runs in the lua_State that was used to call glib_connect with, and therefore probably uses the stack of the main function, which mustn't be modified.

Parameters

  • data: a pointer to a struct callback_info
  • ...: Variable arguments, and finally the object pointer.

Return value:

A value to return to Gtk. In file: src/glib/callback.c line 129
local _callback_return_value (L, return_type, cbi)
Handle return values from the Lua handler to pass back to Gtk. Not many different types are supported - but I think no others are actually used.

Parameters

  • L: lua_State
  • return_type: The GType of the expected return value
  • cbi: callback_info of this signal

Return value:

An integer to return to Gtk. In file: src/glib/callback.c line 57
local _free_callback_info (data, closure)
Free memory on signal handler disconnection. The struct callback_info contains references to entries in the registry of the Lua state. They must be unreferenced, then the structure itself is freed. XXX the Lua state might not exist anymore?

Parameters

  • data:
  • closure:
In file: src/glib/callback.c line 245

Valid XHTML 1.0!