From: Steve Pick <steve@ba...> - 2003-10-26 20:36:39
Oh dear. Serious bug. They're in the same memory. I'll look at the
Win32::GUI code and see if this is a simple bug that even i can fix.
----- Original Message -----
From: "Steve Pick" <steve@...>
Sent: Sunday, October 26, 2003 8:12 PM
Subject: Multiple ImageList bug
> I have some code that creates two ImageList objects:
> our $ARCHIVE = new Win32::GUI::ImageList(64,64,ILC_COLOR32,0,100);
> our $ICONS = new Win32::GUI::ImageList(16,16,ILC_COLOR32 | ILC_MASK,0,10);
> don't worry about those constants, they're defined at the top of my script
> ILC_COLOR32 => 0x00000020,
> ILC_MASK => 0x00000001
> A listview is set to use imagelist $ICONS, and another listview is set to
> use imagelist $ARCHIVE. However, On adding even one image to $ARCHIVE,
> listviews always show images from $ARCHIVE. In fact $ICONS shows 16x16
> segments of 64x64 images added to $ARCHIVE.
> I'm adding images to $ICONS and $ARCHIVE like so:
> $ICONS->Add(new Win32::GUI::Bitmap("resource/downgreen_i.bmp"),new
> # the above is done outside of any subroutine.
> $ARCHIVE->Add(new Win32::GUI::Bitmap("archivetemp.bmp"));
> # the above is done in an addfilestoarchive function.
> I've no idea what's causing $ICONS to always show images from $ARCHIVE.
> $ICONS is filled at the start of the application, $ARCHIVE is cleared and
> filled whenever the addfilestoarchive sub is called.
> Do my bitmap objects need to be persistent or something? I would have
> thought perl's garbage collector would realise not to clear the anonymous
> bitmap objects created with ImageList::Add.
> Steve Pick