- wxOwnerDrawn *pNewItem = CreateItem(idx);
- pNewItem->SetName(items[i]);
- pNewItem->SetFont(GetFont());
- m_aItems.Insert(pNewItem, idx);
+ if ( m_windowStyle & wxLB_OWNERDRAW )
+ {
+ wxOwnerDrawn *pNewItem = CreateItem(idx);
+ pNewItem->SetName(items[i]);
+ pNewItem->SetFont(GetFont());
+ m_aItems.Insert(pNewItem, idx);