The wxTreeItemId class is just a platform independent wrapper around a platform dependent tree item handle and there is nothing that will invalidiate the handles if an item is deleted.
Depending on the platform the handle may just be an index into a data structure and so calling SelectItem may select the next item after the one that was deleted...
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!