Re: Gtk::TreeSortable::set_sort_func Example?



On Thu, 2005-04-21 at 21:07, Rose Cumming wrote:
> Hello,

> Does any one know the semantics of the usage of the set_sort_func?
> 
> I have a class containing a Glib::RefPtr<Gtk::ListStore> listStore object.
> My listStore holds a column of objects of a class in which I have
> overloaded the operators < > <= >= == !=
> 
> How can I set up a sort function to use for that column?
> listStore->set_sort_func(listCols.my_object, ...)
> what does the Gtk::TreeSortable::SlotCompare look like?
> 
MyClass()
{
	m_list_store_ref->set_sort_func (
		0, sigc::mem_fun (*this, &MyClass::on_sort_compare));
}

int 
MyClass::
on_sort_compare (const Gtk::TreeModel::iterator& a_, 
		 const Gtk::TreeModel::iterator& b_)
{
	const Gtk::TreeModel::Row row_a = *a_;
	const Gtk::TreeModel::Row row_b = *b_;
...
	return ret;
}

> I could not find any examples...

-- 
_____________________________________________________________
Vladislav Grinchenko       http://home.comcast.net/~3rdshift/
                                 e-mail: 3rdshift comcast net
                                                   
      Focus on quality, and productivity will follow.
_____________________________________________________________




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