object.connect(signal, callback)
Connect a signal handler.
Example 2.1. GObject.connect()
editor.connect("before-save", function(editor, doc, file) if #doc.get_text() % 2 ~= 0 then moo.error_dialog("Won't save", "Odd number of characters in a file " .. "is bad for your hard drive, I am not " .. "going to save this.", doc.get_window()) return moo.SAVE_RESPONSE_CANCEL else return moo.SAVE_RESPONSE_CONTINUE end end)
|
signal name |
|
function to call when the signal is emitted |
Returns:
id of connected signal handler. Use disconnect()
to remove it.
object.connect_after(signal, callback)
|
signal name |
|
function to call when the signal is emitted |
Returns:
integer
object.disconnect(handler_id)
Disconnect a signal handler.
|
signal handler id returned from |
object.signal_handler_block(handler_id)
Temporarily blocks signal handler so it will not be called when the signal it's connected to is emitted. Call signal_handler_unblock()
to re-enable the signal handler.
|
signal handler id returned from |
object.signal_handler_unblock(handler_id)
Re-enables signal handler disabled by signal_handler_block()
.
|
signal handler id returned from |