dc.SetTextForeground("BLACK")
dc.SetBackgroundMode(wx.TRANSPARENT)
tw, th = dc.GetTextExtent(text)
x = 5
y = rect.y + max(0, (rect.height - th) / 2)
dc.SetTextForeground("BLACK")
dc.SetBackgroundMode(wx.TRANSPARENT)
tw, th = dc.GetTextExtent(text)
x = 5
y = rect.y + max(0, (rect.height - th) / 2)