Re: Tell me about difference between g_signal_connect and g_signal_connect_after



Cool Guy wrote:
In reference,

g_signal_connect : The handler will be called before the default handler
of the signal.
g_signal_connect_after : The handler will be called after the default
handler of the signal.

But, I don't know why is different g_signal_connect and
g_signal_connect_after.

Where is example about difference or explain them?

g_signal_connect_after will let you run your user handler
after the class's default handler; why is this usefull ?

Say I have an object that emits an "initialize" signal in
which its class handler does the work, you probably want
your handler to run after the class handler so that you can
use the already initialized object in your function.

I think normally you dont have to use this method because
signals of that nature are usually installed with G_SIGNAL_RUN_FIRST
which; if I'm not mistaken means that it's default handler
will be called before user handlers anyway.

Cheers,
                            -Tristan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]