是否可以在wx.grid.grid中填充左上角的单元格?
此单元格的显示方式(最多为行标签,从左到列标签)是否可以在wx.grid.grid中填充左上角的单元格?,grid,wxpython,Grid,Wxpython,此单元格的显示方式(最多为行标签,从左到列标签) 可以用文本或图像填充吗?wxPython演示中有一个使用GridLabelRenderer的示例。以下是演示中的相关代码: class MyCornerLabelRenderer(glr.GridLabelRenderer): def __init__(self): import images self._bmp = images.Smiles.getBitmap() def Draw(self,
可以用文本或图像填充吗?wxPython演示中有一个使用GridLabelRenderer的示例。以下是演示中的相关代码:
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)
然后你可以这样称呼它:
myGrid.SetCornerLabelRenderer(MyCornerLabelRenderer())