其实也很简单,就是在文档中没有看到。
Easy enough:
sigc::connection c =
widget.signal_whatever().connect(sigc::mem_fun(whatever, whatever));Then keep hold of c until you want to disconnect, and when you do, call
c.disconnect().Works in libsigc++ 1.2 as well, with the appropriate changes:
SigC::Connection c =
widget.signal_whatever().connect(SigC::slot(whatever, whatever));c.disconnect();
简单点说:
必须维护一个sigc::connection变量,在注销信号时必须使用原始的connection进行。
参考:
http://mail.gnome.org/archives/gtkmm-list/2004-April/msg00030.html
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/apbs03.html
发表回复