+int wxNodeBase::IndexOf() const
+{
+ wxCHECK_MSG( m_list, wxNOT_FOUND, wxT("node doesn't belong to a list in IndexOf"));
+
+ // It would be more efficient to implement IndexOf() completely inside
+ // wxListBase (only traverse the list once), but this is probably a more
+ // reusable way of doing it. Can always be optimized at a later date (since
+ // IndexOf() resides in wxListBase as well) if efficiency is a problem.
+ int i;
+ wxNodeBase *prev = m_previous;
+
+ for( i = 0; prev; i++ )
+ {
+ prev = prev->m_previous;
+ }
+
+ return i;
+}
+