Re: Gtk::TextBuffer::signal_erase()

On Fri, 09 Sep 2011 13:10:53 +1100
"Mr.Cashe" <mrcashe gmail com> wrote:
> Thank you for link.
> With your modifications the output is follows:
> [mrcashe@home test]$ ./test
> on_c_insert(): pos = 14
> on_cxx_insert(): pos = 14
> on_c_erase(): start = 5, end = 5
> on_cxx_erase(): start = 5, end = 5
> Result = This a text
> In other words, both handlers runs after GtkTextBuffer builtin
> handler. The question is: how to install C++ handler BEFORE builtin
> handler? sigc++ does not providing smt. like
> sigc::signal::connect_before(). Am I right or not?

All GTK+ signals are executed through a glibmm SignalProxy object, and
the connect() method that glibmm/gtkmm present you with is a connect
method of the proxy, not of a sigc::signal object.  The connect method
of the SignalProxy takes a second bool 'after' argument, which by
default is true.  Pass a value of false to the 'after' argument of the
connect method if you don't want that.

Annoyingly, this is the obverse of GTK+ signals, which by default
execute the connected callback before the built in handler.


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