GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Jul 29, 2014 6:51 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: TreeView Search Example, Help with multiple columns
PostPosted: Wed Dec 05, 2007 10:19 am 
Offline
Familiar Face

Joined: Sun Nov 05, 2006 8:56 am
Posts: 19
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);
}


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 09, 2007 8:55 am 
Offline
Familiar Face

Joined: Sun Nov 05, 2006 8:56 am
Posts: 19
bump, anybody?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group