Re: [gtkmm] TreeStore on_rows_reordered signal.



On Thu, 2004-03-11 at 20:45, Dennis Craven wrote:
> Hi,
> 
> I have a working TreeStore and TreeView, with the rows set as
> reorderable. I would like to perform some maintenance on the tree
> objects when a row is moved via drag and drop. I thought I had found the
> answer in the "on_rows_reordered" signal, but I'm having troubles
> connecting it to a method that I am writing.
> 
> Here is what I tried to connect the signal:
> 
>   m_refTreeStore->signal_rows_reordered().connect(
>       SigC::slot( *this, &MyTree::on_rows_reordered));
> 
> Then in the MyTree class (where this connection attempt also happens):
> 
> void MyTree::on_rows_reordered()
> {
> 	blah...
> }
> 
> The connect part bombs on compile. I figured I'm doing something
> obviously wrong.
> 
> Thanks for the help.

It would be helpful if you provided the error messages produced by the
compiler so that we have some idea of what's actually going on. However,
from a quick glance at the reference documentation here:
http://www.gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1TreeModel.html
It is apparent that the type of your callback function is wrong.

signal_rows_reordered() is a Glib::SignalProxy3<void, const
TreeModel::Path&, const TreeModel::iterator&, int*> which means the
callback function needs to be of type

void MyTree::on_rows_reordered(const TreeModel::Path&, const
TreeModel::iterator&, int*) {
}

Which yours isn't, and which would have caused the compiler to complain.
I'm afraid I don't know what the parameters actually do as the TreeView
documentation in that area is not complete in gtkmm 2.2.

But in future please post compiler error messages when reporting a
problem involving something not compiling.

Thanks





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