On Thu, 29 Mar 2007 12:09:27 +0000 Greg Chicares <address@hidden> wrote:
GC> Here's the way we're thinking of handling this situation,
GC> in an EVT_TREE_SEL_CHANGED handler:
GC>
GC> wxTreeCtrl& tree = GetTreeCtrl();
GC>
GC> wxTreeItemId item_id = event.GetItem();
GC> if(!item_id.IsOk())
GC> {
GC> item_id = tree.GetRootItem(); // QUESTION
GC> }
GC> LMI_ASSERT( item_id.IsOk() );
GC> ...
IMO this fallback on the (hidden!) root item doesn't make much sense.
Either we should handle the case when item_id is invalid (indicating that
there is no valid selection in the tree). Or we should simply assert that
it's valid immediately.