khchen / wNim

Nim's Windows GUI Framework
MIT License
327 stars 17 forks source link

wNim/wImageList - Icon selection by index fails #64

Closed BugFix closed 4 years ago

BugFix commented 4 years ago

Hello Ward, there is a problem with the procedures getBitmap and getIcon from wNim/wImageList. Both procedures use the parameter index to identify the icon. Actually the index should be passed to the calls of ImageList_GetImageInfo or ImageList_GetIcon. But in both cases 0 is passed statically. So the first icon is always chosen.

getBitmap:

ImageList_GetImageInfo(self.mHandle, 0, &info)

getIcon:

ImageList_GetIcon(self.mHandle, 0, ILD_TRANSPARENT)

The problem can be solved if

cast[int32](index)

is passed instead of 0.

khchen commented 4 years ago

Fixed.