[webkit-gtk] Signals with default handlers
Gavin Lambert
gavinl at compacsort.com
Thu Jun 2 17:48:07 PDT 2011
Quoth Armin Burgmeier:
> You can try connecting your handler before the default handler by
> setting the "after" parameter to false when connecting the signal
> handler:
>
> view.signal_console_message().connect(..., false);
Quoth Kjell Ahlstedt:
> This behavior can be changed by setting the optional argument 'after' in
> connect() to false:
> m_web_view.signal_console_message().connect(sigc::mem_fun(this,
> &MyWindow::on_console_message), false);
> Then your signal handler will be called first. If it returns false, the
> default signal handler will be called. If your signal handler returns
> true, the default signal handler is not called.
Thanks, passing false to connect() did the trick. I think I assumed (evidently incorrectly) that the G_SIGNAL_RUN_LAST flag in the signal definition meant either that the last-registered signal handler would be called first or that the default handler would be called last.
More information about the webkit-gtk
mailing list