connect_raw
Description:
public ulong connect_raw (void* instance, string sig_name, bool private_thread, bool private_job, ThreadWrapperCallback callback)
Connects a callback function to a signal for a particular object.
The difference with connect and similar functions are:
- the
callback
argument is not a ObjectConstructorFunc function, so the callback signature is not dependent on the signal itself - the signal handler must not have to return any value
- the
callback
function will be called asynchronously, the caller may need to use iterate to get the notification - if
private_job
andprivate_thread
control in which case the signal is propagated.
Also note that signal handling is done asynchronously: when emitted in the worker thread, it will be "queued" to be processed in the user thread when it has the chance (when iterate is called directly or indirectly). The side effect is that the callback function is usually called long after the object emitting the signal has finished emitting it.
To disconnect a signal handler, don't use any of the g_signal_handler_*() functions but the disconnect method.
Parameters:
this |
a ThreadWrapper object |
instance |
the instance to connect to |
sig_name |
a string of the form "signal-name::detail" |
private_thread |
set to |
private_job |
set to |
callback |
a ThreadWrapperCallback function |
data |
data to pass to |
Returns:
the handler ID |