[wxPython-users] Notebook image bug on win32,
working on GNU/Linux and Mac OSX
Frank Aune
Frank.Aune at broadpark.no
Fri Sep 28 13:19:51 PDT 2007
On Friday 28 September 2007 20:19:38 Robin Dunn wrote:
> Frank Aune wrote:
> > I still believe this is a bug in the implementation of wx.ImageList on
> > Win32.
>
> If it's just a few K then send it to the list as message attachments,
> that way if I don't have time to look at it somebody else might.
Actually I got hold of a win32 box today, and I found the reason for the
plattform difference:
On GNU/Linux and Mac OSX a notebook image follows the originally assigned
notebook tab regardless, even if you afterwards remove/add other tabs.
On win32 OTOH, if you set image X for notebook tab Y, image X will always be
assigned to the tab occupying position Y - even if you add new tabs before
the original tab in Y and thus "push" it further to the right.
To recap for win32:
A new tab inserted in position Y will automatically be assigned the image
which the previous tab in position Y had.
A tab removed from position Y, will cause the last tab in the notebook to
loose its picture. The reason is that my code remove both the tab and the
image from the ImageList for position Y, but wx insists that the last tab in
the notebook should have the originally defined image in the ImageList. But
since the ImageList now is 1 image shorter (due to the tab removal), wx does
not have a reference to the originally defined image for the last tab and
thus display no image.
Solution:
I tried remapping the images after removing a tab on win32, and then it works
exactly as it does on GNU/Linux and Mac OSX.
I still think this is a bug, but I guess its debatable if the GNU/Linux and
Mac OSX or Win32 behavior is the desired one :-)
More information about the wxpython-users
mailing list