Re: Monitor IO



Check the libsigc++ manual here:
http://libsigc.sourceforge.net/libsigc2/docs/manual/html/index.html

It explains the usage of ptr_fun, mem_fun...etc.

Anyways.. in this case, if your "member function" is static then yes, it can be a member function (method of a class).

----- Original Message -----
From: inbox_pub earthlink net
To: gtkmm-list gnome org
Sent: Wed, Jan 21, 2009 4:23:28 PM +0100
Subject: Monitor IO

When using the form:

Glib:signal_io().connect(sigc::ptr_fun(MyCallback), read_fd, Glib::IO_IN);

can the MyCallback in ptr_fun(MyCallback) be a member function?



klaus triendl wrote:
inbox_pub earthlink net schrieb:
In Chapter 21 of the documentation, in the Monitor IO section, the
signal connection statement is:
   Glib:signal_io().connect(sigc::ptr_fun(MyCallback), read_fd,
Glib::IO_IN);
Can this be done with member functions using something like:
   Glib:signal_io().connect(sigc::mem_fun(MyCallback) . . .
or can "MyCallback" be a member function?

Yes, it can be a member function.
Depending on from where you connect to the signal, exchange 'this'
appropriately:

Glib::signal_io().connect(sigc::mem_fun(this, &MyClass::MyCallback), ...);



Klaus



------------------------------------------------------------------------

_______________________________________________
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]