【发布时间】:2014-03-21 16:00:54
【问题描述】:
我正在尝试将超时处理程序连接到我的 gtkmm 代码,如gtkmm book 所示。但是,我的特定 on_timeout() 函数不需要任何参数,并且我正在努力正确创建一个 sigc::slot 对象以传递给 connect 函数,因为我遇到了以下错误(以及其他错误):
error: no matching function for call to ‘bind(sigc::bound_mem_functor0<bool, DerivedWindow>)
还有几个
candidate expects 2 arguments, 1 provided
参考sigc::bind。我如何调用这两个函数:
_timeout_slot = sigc::bind(sigc::mem_fun(*this,&DerivedWindow::on_timeout));
_connection = Glib::signal_timeout().connect(_timeout_slot,timeout_value);
我正在对派生自 Gtk::Window 的类 DerivedWindow 执行此操作。我到底做错了什么?如果不需要任何参数,是否需要使用sigc::bind 和sigc::mem_func?
【问题讨论】: