Re: no duplicate items TreeView/ListStore
- From: Jason Burchfield <jason burchfield cas-inc com>
 
- To: Jason Burchfield <jason burchfield cas-inc com>
 
- Cc: gtkmm-list gnome org
 
- Subject: Re: no duplicate items TreeView/ListStore
 
- Date: Thu, 16 Jun 2005 09:05:21 -0500
 
Jason Burchfield wrote:
I'm still not understanding the TreeView/ListStore classes very well.  
Could anyone tell me how to not allow duplicate items in just a simple 
list?
The only way I have found to do it is make a callback function...
and use a bool m_UserNameFound to determine if it is in the list.  Is 
there a better way?
m_refListStore->foreach_iter( sigc::mem_fun( *this, 
&winPreferences::m_bFindUserName ) );
bool winPreferences::m_bFindUserName( const Gtk::TreeModel::iterator 
&iter ){
  
   Glib::ustring strText = txt_D_User_Name->get_text();
   Gtk::TreeModel::Row row = *iter;
   string strTest = row[m_ModelColumns.m_col_text];
  
   if ( strText == strTest ){
       m_UserNameFound = true;
       return true;
   }
  
   else
       return false;
  
}
--
Jason Burchfield
CAS, Inc.
(256) 971-6096
Jason Burchfield cas-inc com
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]