RE: Signals with default handlers
- From: "Gavin Lambert" <gavinl compacsort com>
- To: "'Armin Burgmeier'" <armin arbur net>, "'Kjell Ahlstedt'" <kjell ahlstedt bredband net>
- Cc: webkit-gtk lists webkit org, gtkmm-list gnome org
- Subject: RE: Signals with default handlers
- Date: Fri, 3 Jun 2011 12:48:07 +1200
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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]