wx.EVT_ERASE_BACKGROUND is not fired. (wxPython 2.9.4.0.)

I use wxPython 2.9.4.0. unicode (windows 7)

I found that wx.EVT_ERASE_BACKGROUND is not fired.

DragImage code in wxPython 2.9 Demo

—> cannot paint background…

How can I paint my custom background.

jayu108 wrote:

I use wxPython 2.9.4.0. unicode (windows 7)
I found that wx.EVT_ERASE_BACKGROUND is not fired.

DragImage code in wxPython 2.9 Demo
---> cannot paint background..
How can I paint my custom background.

You probably need to call the window's SetBackgroundStyle method, although sending erase events should be the default. See:

http://docs.wxwidgets.org/2.9.5/classwx_window.html#af14f8fd2ed2d30a9bbb5d4f9fd6594ec
http://docs.wxwidgets.org/2.9.5/defs_8h.html#a4bc8ece80d508fd70283b5a3b4c41e5f

···

--
Robin Dunn
Software Craftsman

Thank You!!!

Now, I find what is problem due to your advice.

DragImage example code in wxPython 2.9 Demo

—> self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) ===> this is problem…

; delete above line! → Good operation!!

2013년 8월 7일 수요일 오전 10시 46분 53초 UTC+9, Robin Dunn 님의 말:

···

jayu108 wrote:

I use wxPython 2.9.4.0. unicode (windows 7)

I found that wx.EVT_ERASE_BACKGROUND is not fired.

DragImage code in wxPython 2.9 Demo

—> cannot paint background…

How can I paint my custom background.

You probably need to call the window’s SetBackgroundStyle method,
although sending erase events should be the default. See:

http://docs.wxwidgets.org/2.9.5/classwx_window.html#af14f8fd2ed2d30a9bbb5d4f9fd6594ec

http://docs.wxwidgets.org/2.9.5/defs_8h.html#a4bc8ece80d508fd70283b5a3b4c41e5f


Robin Dunn

Software Craftsman

http://wxPython.org