fixes the invalid index problem
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -294,7 +294,7 @@ void wxListBox::Append(const wxString& item)
|
|||||||
|
|
||||||
#if wxUSE_OWNER_DRAWN
|
#if wxUSE_OWNER_DRAWN
|
||||||
if ( m_windowStyle & wxLB_OWNERDRAW ) {
|
if ( m_windowStyle & wxLB_OWNERDRAW ) {
|
||||||
wxOwnerDrawn *pNewItem = CreateItem(-1); // dummy argument
|
wxOwnerDrawn *pNewItem = CreateItem(index); // dummy argument
|
||||||
pNewItem->SetName(item);
|
pNewItem->SetName(item);
|
||||||
m_aItems.Add(pNewItem);
|
m_aItems.Add(pNewItem);
|
||||||
ListBox_SetItemData(hwnd, index, pNewItem);
|
ListBox_SetItemData(hwnd, index, pNewItem);
|
||||||
|
Reference in New Issue
Block a user