[2.7.0] bug in wxListCtrl or undocumented feature
Vadim Zeitlin
vadim at wxwindows.org
Sat Sep 9 18:44:40 PDT 2006
On Tue, 05 Sep 2006 22:58:45 +0200 H <H at h.com> wrote:
H> Then, the scenario looks like:
H>
H> - create and fill image list
H> - create and fill list
H> - create link between image list and list
I could be missing something but I think the only real constraint is that
the first step must be done first. But you can associate the item index
with the item immediately when you're adding it to the list, not later.
H> This works as long as the image list is not empty when the list itself
H> is created and filled up.
Yes.
H> But in my case the list is filled up by user interaction. And it can
H> happen that some items in the list are not associated with an image in
H> the image list. So, in these cases - without any additional precautions
H> from my side - it can happen that the program crashes if these items are
H> entered by the user in the beginning.
It's not a typical use of wxImageList, normally it contains a fixed number
of images while in your case, AFAIU, its contents is user-defined. So,
indeed, unusual precautions must be taken.
H> BTW: Is there any possibility to detach the image list again from the
H> list?
What about calling SetImageList() with a dummy empty image list?
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list