strange flicker button

Hi all.

A part of my application is composed of a frame that invokes another frame.

The child frame has as wx.FRAME_FLOAT_ON_PARENT style and has several buttons including the “Load” button that when pressed calls a FileDialog.

Now when I press the load button it has a strange and annoying flicker. I noticed that this flicker does not occur if I do not set the foreground color Load button.

What strange thing is happening?

Attached script.

_bufferreader.py (4.5 KB)

···


Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

www.sqliteroot.com

Hi.

Any Idea?

···


Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

www.sqliteroot.com

Hi Fabio,

Hi.
Any Idea?

I don't see any flicker, on Win7, Py 2.6.5 and wx 2.8.11.0.

Initially I wasn't sure and I removed the evt.Skip in the handler, but with or without I don't see a flicker.

I changed your sample to leave the Save button with standard font/colour and call the same handler as for Load and they look as if they behave the same to me.

Are you seeing this on Windows or on another platform?

Werner

···

On 24/02/2012 12:07, Fabio Spadaro wrote:

Checked on osx 2.7.1 and wx 2.8.11.0

No flickering ...

Cheers

···

Hi Fabio,

On 24/02/2012 12:07, Fabio Spadaro wrote:

Hi.
Any Idea?

I don't see any flicker, on Win7, Py 2.6.5 and wx 2.8.11.0.

Initially I wasn't sure and I removed the evt.Skip in the handler, but with or without I don't see a flicker.

I changed your sample to leave the Save button with standard font/colour and call the same handler as for Load and they look as if they behave the same to me.

Are you seeing this on Windows or on another platform?

Werner

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Hi

···

Il giorno 24 febbraio 2012 14:25, werner wbruhin@free.fr ha scritto:

Hi don’t see any flicker, on Win7, Py 2.6.5 and wx 2.8.11.0.

Initially I wasn’t sure and I removed the evt.Skip in the handler, but with or without I don’t see a flicker.

I changed your sample to leave the Save button with standard font/colour and call the same handler as for Load and they look as if they behave the same to me.

Are you seeing this on Windows or on another platform?

Werner

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Windows Vista, python 2.7.2, wxPython 2.8.12.1 (msw-unicode).
Whe flicker refers to the fact that the button disappears for a brief moment.


Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

www.sqliteroot.com

I can reproduce it on windows 7, with both with wx 2.8.11 and 2.9.3.

···

On Fri, 24 Feb 2012 14:33:48 +0100, Fabio Spadaro <fabiolinospad@gmail.com> wrote:

Windows Vista, python 2.7.2, wxPython 2.8.12.1 (msw-unicode).
Whe flicker refers to the fact that the button disappears for a brief
moment.

Hhm, if I run it in WingIDE I see it too. Probably due to WingIDE running it in its debugger and slowing it down a bit.

BTW, WingIDE also complained about the SetFont lines, they are all missing the font family, the lines should be something like this:

self.buttonLoad.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL, wx.BOLD))

i.e. I added wx.SWISS.

Also tried:
- no font setting
- calling handler directly instead of using CallAfter

It still disappears very shortly.

Werner

···

On 24/02/2012 16:53, Toni Ru�a wrote:

On Fri, 24 Feb 2012 14:33:48 +0100, Fabio Spadaro > <fabiolinospad@gmail.com> wrote:

Windows Vista, python 2.7.2, wxPython 2.8.12.1 (msw-unicode).
Whe flicker refers to the fact that the button disappears for a brief
moment.

I can reproduce it on windows 7, with both with wx 2.8.11 and 2.9.3.

Hi,

Windows Vista, python 2.7.2, wxPython 2.8.12.1 (msw-unicode).
Whe flicker refers to the fact that the button disappears for a brief
moment.

IIRC some controls when you switch colors on them cause the control to
fallback and use a generic wx drawing routine. This could result in
the flashing due to the usual suspects of erase background handlers,
ect...

This is also in tandem with the SetBackgroundColour call you do on the
frame which causes custom background drawing to be done.

I can't reproduce the issue your seeing but would suggest the
following to track it down.

1) Use a Panel as the parent of the buttons and not the Frame.
Frame=>Panel=>Controls.

2) If the above doesnt help then try handling the buttons erase
background event and doing nothing in the handler (i.e pass).

Cody

···

On Fri, Feb 24, 2012 at 10:16 AM, werner <wbruhin@free.fr> wrote:

On 24/02/2012 16:53, Toni Ruža wrote:

On Fri, 24 Feb 2012 14:33:48 +0100, Fabio Spadaro >> <fabiolinospad@gmail.com> wrote:

Hi

···

Il giorno 24 febbraio 2012 17:27, Cody codyprecord@gmail.com ha scritto:

IIRC some controls when you switch colors on them cause the control to

fallback and use a generic wx drawing routine. This could result in

the flashing due to the usual suspects of erase background handlers,

ect…

This is also in tandem with the SetBackgroundColour call you do on the

frame which causes custom background drawing to be done.

I can’t reproduce the issue your seeing but would suggest the

following to track it down.

  1. Use a Panel as the parent of the buttons and not the Frame.

Frame=>Panel=>Controls.

  1. If the above doesnt help then try handling the buttons erase

background event and doing nothing in the handler (i.e pass).

Cody

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Ok the handling event does work.
Thanks a lot.


Fabio Spadaro

Try Sqlite Root a GUI Admin Tools for manage Sqlite Database:

www.sqliteroot.com