As I understand it; In the context of wxListCtrl’s insertItem method, ImageIndex refers to the index of the image associated with the item being inserted. This index is used to specify which image from the image list should be displayed alongside the item’s label in the list control.
Consistent with the insertItem method, how should a list be converted into an ImageIndex?
The image index is returned from wxImageList:add().
You create a wxImageList, and attach it to the list control by using wxListCtrl:assignImageList. Then, as you add images to the image list, you can use the returned indexes when adding items to the list control.
I haven’t checked, but I assume that if you always add the same images to the list in the same order, you’ll always get the same image indexes, so you can use constants – 0 is a dog, 1 is a fish, 2 is a cat, and so on.
1 Like
That makes sense to me now. Thank you once again for your insightful answers, Roger. 