Transparent background in wx.ListCtrl icons on XP

Hi all,
I'm seeing an annoying problem with icons inside a (virtual)
wx.ListCtrl..
The icons are all 16 x 16, 8-bit/color RGBA, non-interlaced PNGs, and
they show up fine under Linux (Ubuntu 9.04, wxPython 2.8.9.1).

Under XP (wxPython 2.8.9.2) they have a white background, please see
the screenshot here:
http://g.imagehost.org/0348/listctrl_alpha.png

I'd expect the selection bar to "color" the background of the icons
too, instead.. Am I missing something? Maybe wxMSW needs some special
adjustment?
Many thanks!

Joril wrote:

Hi all,
I'm seeing an annoying problem with icons inside a (virtual)
wx.ListCtrl..
The icons are all 16 x 16, 8-bit/color RGBA, non-interlaced PNGs, and
they show up fine under Linux (Ubuntu 9.04, wxPython 2.8.9.1).

Under XP (wxPython 2.8.9.2) they have a white background, please see
the screenshot here:
http://g.imagehost.org/0348/listctrl_alpha.png

I'd expect the selection bar to "color" the background of the icons
too, instead.. Am I missing something? Maybe wxMSW needs some special
adjustment?

IIRC the native listview widget on MSW doesn't use the alpha layer in the images, but will use a mask. Try editing your images to have 1-bit alpha instead of 8-bit, then when wx loads them it will create a wx.Bitmap with a mask.

···

--
Robin Dunn
Software Craftsman

I tried converting them to 24bit and 8bit 1-bit alpha .ICOs using
GIMP, but the white background is still there.. :confused: Is there another
list implementation that would behave correctly perhaps? (supporting
the "virtual" behavior)

Thanks!

···

On 28 Mag, 18:21, Robin Dunn <ro...@alldunn.com> wrote:

> I'm seeing an annoying problem with icons inside a (virtual)
> wx.ListCtrl..
> The icons are all 16 x 16, 8-bit/color RGBA, non-interlaced PNGs, and
> they show up fine under Linux (Ubuntu 9.04, wxPython 2.8.9.1).

> Under XP (wxPython 2.8.9.2) they have a white background, please see
> the screenshot here:
> http://g.imagehost.org/0348/listctrl_alpha.png

IIRC the native listview widget on MSW doesn't use the alpha layer in
the images, but will use a mask. Try editing your images to have 1-bit
alpha instead of 8-bit, then when wx loads them it will create a
wx.Bitmap with a mask.

Hi,

> I'm seeing an annoying problem with icons inside a (virtual)
> wx.ListCtrl..
> The icons are all 16 x 16, 8-bit/color RGBA, non-interlaced PNGs, and
> they show up fine under Linux (Ubuntu 9.04, wxPython 2.8.9.1).

> Under XP (wxPython 2.8.9.2) they have a white background, please see
> the screenshot here:
> http://g.imagehost.org/0348/listctrl_alpha.png

IIRC the native listview widget on MSW doesn't use the alpha layer in
the images, but will use a mask. Try editing your images to have 1-bit
alpha instead of 8-bit, then when wx loads them it will create a
wx.Bitmap with a mask.

I tried converting them to 24bit and 8bit 1-bit alpha .ICOs using
GIMP, but the white background is still there.. :confused: Is there another
list implementation that would behave correctly perhaps? (supporting
the "virtual" behavior)

You might try with my UltimateListCtrl here:

http://xoomer.alice.it/infinity77/main/UltimateListCtrl.html

Which is a pure-Python implementation of wx.ListCtrl. I didn't do so
much testing, and as far as I know even less testing has been done on
GTK and Mac, so I have no idea if it will behave correctly for your
needs. In any case, bug reports and (much better) patches are welcome.
UltimateListCtrl is not part of wx.lib.agw but if we can verify that
it works well enough on all the 3 major platforms then we may think to
include it there.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Fri, May 29, 2009 at 8:09 AM, Joril wrote:

On 28 Mag, 18:21, Robin Dunn <ro...@alldunn.com> wrote:

Very easy to swap to wx.ListCtrl, great! :slight_smile:
With ULC the transparency problem is gone, but it somehow creates
another glitch with a gizmos.TreeListCtrl that I have in the same
frame.. ?_? After a few clicks the tree stops responding to expand/
collapse requests, while if I rollback to the simple ListCtrl it works
normally.. I'll let you know if I succeed in pinpointing the issue :slight_smile:

···

On 29 Mag, 10:20, Andrea Gavana <andrea.gav...@gmail.com> wrote:

You might try with my UltimateListCtrl here:

http://xoomer.alice.it/infinity77/main/UltimateListCtrl.html