wx.BitmapButton does not erase old image

This also happens on wxPython Demo.

When defined a BitmapSelected, the “selected” image is still there after the mouse-up event.

Like this:
. STEP 1 - BitmapButton main image - OK
. STEP 2 - Click. BitmapSelected is shown, main image is not erased - NOK
. STEP 3 - Unclick - main image is show, BitmapSelected is not erased - NOK
. STEP 4 - ALT-TAB + ALT-TAB - BitmapSelected is erased - NOK

Like the images attached.

Configuration:
. WinXP SP2 64 bits
. Python 2.7 32 bits
. wxPython 2.8

Is this a bug? Is this supposed to work like this? If so, what can I do to avoid this behaviour?

Thanks in advance.

Fabio

step1.png

step2.png

step3.png

step4.png

I think that it is just the native button widget not fully erasing itself when redrawing the button. It probably assumes that you are not using images with transparency, which is what I would suggest to work around the issue.

···

On 5/18/12 9:16 AM, Fabio Mazzarino wrote:

This also happens on wxPython Demo.

When defined a BitmapSelected, the "selected" image is still there after
the mouse-up event.

Like this:
. STEP 1 - BitmapButton main image - OK
. STEP 2 - Click. BitmapSelected is shown, main image is not erased - NOK
. STEP 3 - Unclick - main image is show, BitmapSelected is not erased - NOK
. STEP 4 - ALT-TAB + ALT-TAB - BitmapSelected is erased - NOK

Like the images attached.

Configuration:
. WinXP SP2 64 bits
. Python 2.7 32 bits
. wxPython 2.8

Is this a bug? Is this supposed to work like this? If so, what can I do
to avoid this behaviour?

--
Robin Dunn
Software Craftsman

I have implemented a workaround fot this issue:

http://paste2.org/p/2027800

I have used EVT_MOUSE_UP, EVT_MOUSE_DOWN, EVT_BUTTON_UP and EVT_BUTTON_DOWN.

It worked for me, not good enough, but worked.

···

On Friday, May 18, 2012 2:05:17 PM UTC-3, Robin Dunn wrote:

On 5/18/12 9:16 AM, Fabio Mazzarino wrote:

This also happens on wxPython Demo.

When defined a BitmapSelected, the “selected” image is still there after

the mouse-up event.

Like this:

. STEP 1 - BitmapButton main image - OK

. STEP 2 - Click. BitmapSelected is shown, main image is not erased - NOK

. STEP 3 - Unclick - main image is show, BitmapSelected is not erased - NOK

. STEP 4 - ALT-TAB + ALT-TAB - BitmapSelected is erased - NOK

Like the images attached.

Configuration:

. WinXP SP2 64 bits

. Python 2.7 32 bits

. wxPython 2.8

Is this a bug? Is this supposed to work like this? If so, what can I do

to avoid this behaviour?

I think that it is just the native button widget not fully erasing
itself when redrawing the button. It probably assumes that you are not
using images with transparency, which is what I would suggest to work
around the issue.


Robin Dunn

Software Craftsman

http://wxPython.org

Just a comment about not erasing itself.

I think that this is not acceptable. I did a workaround but that should be the default behaviour.

If keeping the previous image as background should be a valid behaviour, after two alt-tabs the state should be the same. It’s unacceptable to have two different situations after a simple redraw.

IMO it should be treated as a bug.

···

On Friday, May 18, 2012 2:05:17 PM UTC-3, Robin Dunn wrote:

On 5/18/12 9:16 AM, Fabio Mazzarino wrote:

This also happens on wxPython Demo.

When defined a BitmapSelected, the “selected” image is still there after

the mouse-up event.

Like this:

. STEP 1 - BitmapButton main image - OK

. STEP 2 - Click. BitmapSelected is shown, main image is not erased - NOK

. STEP 3 - Unclick - main image is show, BitmapSelected is not erased - NOK

. STEP 4 - ALT-TAB + ALT-TAB - BitmapSelected is erased - NOK

Like the images attached.

Configuration:

. WinXP SP2 64 bits

. Python 2.7 32 bits

. wxPython 2.8

Is this a bug? Is this supposed to work like this? If so, what can I do

to avoid this behaviour?

I think that it is just the native button widget not fully erasing
itself when redrawing the button. It probably assumes that you are not
using images with transparency, which is what I would suggest to work
around the issue.


Robin Dunn

Software Craftsman

http://wxPython.org

On Friday, May 18, 2012 2:05:17 PM UTC-3, Robin Dunn wrote:

On 5/18/12 9:16 AM, Fabio Mazzarino wrote:

This also happens on wxPython Demo.

When defined a BitmapSelected, the “selected” image is still there after

the mouse-up event.

Like this:

. STEP 1 - BitmapButton main image - OK

. STEP 2 - Click. BitmapSelected is shown, main image is not erased - NOK

. STEP 3 - Unclick - main image is show, BitmapSelected is not erased - NOK

. STEP 4 - ALT-TAB + ALT-TAB - BitmapSelected is erased - NOK

Like the images attached.

Configuration:

. WinXP SP2 64 bits

. Python 2.7 32 bits

. wxPython 2.8

Is this a bug? Is this supposed to work like this? If so, what can I do

to avoid this behaviour?

I think that it is just the native button widget not fully erasing
itself when redrawing the button. It probably assumes that you are not
using images with transparency, which is what I would suggest to work
around the issue.


Robin Dunn

Software Craftsman

http://wxPython.org