- wxDirItemData *new_data = new wxDirItemData( path, new_name );
- wxTreeItemId new_id = m_dir->AppendItem( parent, new_name, 0, 1, new_data );
- m_dir->EnsureVisible( new_id );
- m_dir->EditLabel( new_id );
-#endif
+ wxDirItemDataEx *new_data = new wxDirItemDataEx( path, new_name, TRUE );
+
+ // TODO: THIS CODE DOESN'T WORK YET. We need to avoid duplication of the first child
+ // of the parent.
+ wxTreeItemId new_id = m_dirCtrl->GetTreeCtrl()->AppendItem( parent, new_name, 0, 0, new_data );
+ m_dirCtrl->GetTreeCtrl()->EnsureVisible( new_id );
+ m_dirCtrl->GetTreeCtrl()->EditLabel( new_id );