[wxPython-users] About wx.Window default OnPaint function
甜瓜
littlesweetmelon at gmail.com
Mon Jan 7 07:48:35 PST 2008
Howdy,
I notice that there is a OnPaint method exported from wx.Window,
but it is not documented in the wxpython online doc. I wonder what it
is used for?
Will OnPaint do all default paintings according to the type of
window? If so, it will be really useful in the case of custom
controls. For example, I want to do some owner draw:
class MyBitmapButton(wx.BitmapButton):
def __init__(...):
self.Bind(wx.EVT_PAINT, self.OnPaint)
...
def OnPaint(self, evt):
# Here, I want to draw something AFTER the wx.BitmapButton
default drawings.
# so:
wx.BitmapButton.OnPaint(self, evt)
... # do my drawings.
Above code is not tested yet. I wonder whether it works and
whether it is a generally correct for all wx controls.
Again, wxWidget::ScrolledWindow exports OnDraw method to simplify
DoPrepareDC, but why is there no corresponding method in
wx.ScrolledWindow?
Best regards,
---
ShenLei
More information about the wxpython-users
mailing list