I need help with the TreeView Search Example, I don't quite understand how it works, I've found two examples random internet search and pidgin.
I want to be able to search multiple columns; Is this possible?
Here is what I have so far:
Code:
// set the search column:
m_TreeView.set_search_column(m_Columns.m_col_last_name);
// connect the search function:
m_TreeView.set_search_equal_func(sigc::mem_fun(*this, &CMainWindow::TreeViewSearchFunc) );
// handle the search function
bool CMainWindow::TreeViewSearchFunc(const Glib::RefPtr<Gtk::TreeModel>& model, int column, const Glib::ustring& key, const Gtk::TreeModel::iterator& iter)
{
Glib::ustring substr(key.uppercase());
Glib::ustring LastName((*iter)[m_Columns.m_col_last_name]);
LastName=LastName.uppercase();
std::cout << LastName << "\t Column: " << column << "\n";
return (LastName.find(substr)==Glib::ustring::npos);
}