[gtkmm] binding arguments to slots



(I felt this list was more appropriate than libsigc-list gnome org 
because I think the latter is for a newer version of libsigC++ than 
the one I'm using with Gtkmm, please forgive & correct me if I'm 
wrong)

I want to bind another argument to the signal between a 
CellRendererText and the TreeView ((to handle adapting the edited 
value to the model).

I don't understand the error message I get :


GrilleEval.cxx:68: error: no matching function for call to `bind(
   SigC::Slot5<void, const Glib::ustring&, const Glib::ustring&, 
   Gtk::TreeModelColumn<Glib::ustring>*, Gtk::TreeView*, 
   <unnamed>::TestAdapt&>, Gtk::TreeModelColumn<Glib::ustring>*&, 
   Gtk::TreeView*, <unnamed>::TestAdapt&)'

TestAdapt is my adaptor class.
The signatures look OK to me.
For what it's worth the code triggering it is

template<typename DataModel, typename EditedType, typename Adapt>
static void connectModelEditor(Gtk::TreeView& treeView, 
boost::tuple<Gtk::TreeModelColumn<DataModel>*, 	
	Glib::SignalProxy2<void,const Glib::ustring&, EditedType>, Adapt >& 
t)
{
boost::get<1>(t).connect(SigC::bind(SigC::slot(&on_cellrenderer_edited_adapted<DataModel, 
EditedType, Adapt>),
boost::get<0>(t), 
&treeView, 
boost::get<2>(t)));}

with
template<typename DataModel, typename EditedType, typename Adapt>
static void 
on_cellrenderer_edited_adapted(const Glib::ustring& path_string,
 EditedType newValue, Gtk::TreeModelColumn<DataModel>* pModelColumn,
 Gtk::TreeView* treeView, Adapt& a )
{
  if(Gtk::TreeModel::iterator iter = 
treeView->get_model()->get_iter(path_string))
    iter->set_value(*pModelColumn, a(newValue));
}

Yes I love templates :-)

Does anybody understand why the compiler does not find a correct bind 
?

Thank you very much for any hint.

Bernard



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