Re: Gtk::TextBuffer::signal_erase()



Hi Mr.Cashe,

I have tested my modified version of your test case both with gtkmm 2
and gtmm 3. In both cases the result is

on_cxx_insert(): pos = 0
on_c_insert(): pos = 14
on_cxx_erase(): start = 5, end = 8
on_c_erase(): start = 5, end = 5
Result = This a text

Did you really add the parameter 'false' in
  tb->signal_insert().connect(sigc::ptr_fun(on_cxx_insert), false);
  tb->signal_erase().connect(sigc::ptr_fun(on_cxx_erase), false);

See also Chris Vine's explanation.

Kjell

fre 2011-09-09 klockan 12:18 +0100 skrev Chris Vine:
> 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.
> 
> Chris
> 
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list




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