Anyway, if using the wxLC_VIRTUAL flag then you MUST
override OnGetItemText and OnGetItemImage in the
derived class. The latter can just return -1 if
there
are no images.
Yes, overriding OnGetItemImage to return -1 fixed my
problem, no more worthless asserts getting tripped.
The only thing is that according to the wxWindows
documentation, only OnGetItemText is required to be
overridden.
From wx.chm:
"To use virtual list control you must use SetItemCount
first and overload at least OnGetItemText (and
optionally OnGetItemImage and OnGetItemAttr) to return
the information about the items when the control
requests it."
Before I go yell at the wxWindows folks, I need to
know if this is something specific to wxPython. Anyone
have a c++ compiler under win32 they could try this on?
···
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
"To use virtual list control you must use SetItemCount
first and overload at least OnGetItemText (and
optionally OnGetItemImage and OnGetItemAttr) to return
the information about the items when the control
requests it."
Before I go yell at the wxWindows folks, I need to
know if this is something specific to wxPython. Anyone
have a c++ compiler under win32 they could try this on?
The assert is definitly in the C++. Here's the code:
wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col))
const
{
// this is a pure virtual function, in fact - which is not really pure
// because the controls which are not virtual don't need to implement it
wxFAIL_MSG( _T("not supposed to be called") );
return wxEmptyString;
}
int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const
{
// same as above
wxFAIL_MSG( _T("not supposed to be called") );
return -1;
}
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!