class TMListBox(wx.ListBox):
def __init__(self,parent,id=-1,pos=wx.DefaultPosition,size=wx.DefaultSize,
choices=None,style=wx.TRANSPARENT_WINDOW,validator=wx.DefaultValidator, name='TMListBox'):
wx.ListBox.__init__(self,parent,id,pos,size,choices,style,validator,name)
self.Bind(wx.EVT_PAINT,self.on_paint)
self.Bind(wx.EVT_ERASE_BACKGROUND,lambda e: None)
self.Bind(wx.EVT_SIZE,self.on_size)
def on_paint(self,e):
bdc=wx.PaintDC(self)
dc=wx.GCDC(bdc)
font_face=self.GetFont()
font_color=self.GetForegroundColour()
dc.SetFont(font_face)
dc.SetTextForeground(font_color)
def on_size(self,e):
self.Refresh()
e.Skip()
请教哪位大神,上面代码错哪了