Re: I/O Monitor signal connection



Hi,

like José saig. Use sigc::bind like this:

-------- snip --------
Glib::signal_io().connect(sigc::bind<Glib::ustring>(sigc::ptr_fun(MyCallback), "test#1"), read_fd, Glib::IO_IN);

bool MyCallback(Glib::IOCondition io_condition, Glib::ustring
&extra_arg)
{
  ...
  std::cout << extra_arg << buf ;
  ...

}
-------- snap --------

Am Mittwoch, den 18.08.2010, 17:45 -0700 schrieb lautarox:
> Yeah, but look at the requirments, "sigc::connection
> Glib::SignalInput::connect(const sigc::slot<bool,Glib::IOCondition>& slot,
> int fd, Glib::IOCondition condition, int priority =
> Glib::PRIORITY_DEFAULT);"
> And it says the function should be called like this:
> "The slot signal handler should be declared as follows:
> bool input_callback(Glib::IOCondition condition);"
> It already has an argument, how should I use sigc::bind() if it already has
> an argument?
> Thanks!
> 
> 
> José Alburquerque wrote:
> > 
> > On Aug 16, 2010, at 9:31 PM, lautarox <lausuper gmail com> wrote:
> > 
> >> 
> >> I really need an answer, I don't know how to pass an argument to the
> >> function
> >> if it already has one, the condition, is it even posible?
> > 
> > It is.  Use sigc::bind():
> > http://library.gnome.org/devel/gtkmm-tutorial/stable/sec-binding-extra-arguments.html.en
> > 
> > --
> > José
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > 
> > 
> 

Attachment: signature.asc
Description: This is a digitally signed message part



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