But it's spent a lot of time when list item is too large.
So I try to load part of the list item use wxThread.
But when I load item in thread ,then error [......vector.h(404) assert "idx < m_size" failed in at().] has occurred.
And here is my code.
Code: Select all
wxThread::ExitCode XXCtrlThread::Entry()
{
while (TestDestroy())
{
return NULL;
}
m_pHandler->LoadXXList();
return (wxThread::ExitCode)0; // success
}
.
.
.
vector<wxTreeListItem> tmp_items;
vector<vector<int>> tmp_keys;
.
.
.
void XXListCtrl::LoadXXList()
{
for(size_t i = 0; i < tmp_items.size();i++)
{
wxString text;
for(size_t j = 5000;j<tmp_keys[i].size();j++)
{
text<<tmp_keys[i][j];
AppendItem(tmp_items[i],text);
text.clear();
}
}
}
Or how to be quickly load list item when list item is too large.