Fix annoying assertion failure in the treectrl sample
Don't pass invalid item to wxTreeCtrl::SelectItem(), just don't select anything if there is no current item.
This commit is contained in:
@@ -594,7 +594,9 @@ void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnSelect(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_treeCtrl->SelectItem(m_treeCtrl->GetFocusedItem());
|
||||
const wxTreeItemId focus = m_treeCtrl->GetFocusedItem();
|
||||
if ( focus.IsOk() )
|
||||
m_treeCtrl->SelectItem(focus);
|
||||
}
|
||||
|
||||
void MyFrame::OnSelectRoot(wxCommandEvent& WXUNUSED(event))
|
||||
|
Reference in New Issue
Block a user