2011-11-26 70 views

回答

0

在使用GridLabelRenderer的wxPython演示中有一個示例。下面是從演示的相關代碼:

myGrid.SetCornerLabelRenderer(MyCornerLabelRenderer())

class MyCornerLabelRenderer(glr.GridLabelRenderer): 
    def __init__(self): 
     import images 
     self._bmp = images.Smiles.getBitmap() 

    def Draw(self, grid, dc, rect, rc): 
     x = rect.left + (rect.width - self._bmp.GetWidth())/2 
     y = rect.top + (rect.height - self._bmp.GetHeight())/2 
     dc.DrawBitmap(self._bmp, x, y, True) 

然後你做這樣的事情叫它

相關問題