Hi,
Is there a way to setup a background image for wx.grid ???
Regards,
Steph
Hi,
Is there a way to setup a background image for wx.grid ???
Regards,
Steph
I have got a background image I want to plug in the whole grid background.
I tried setting up a GridCellRenderer
This works nice , until I scroll …
I would like the same background independently of scrolling, I tried computing the scroll start position in the view, but it does not work , looks like there is an offset ?
here is my code
class BitmapRenderer(wx.grid.PyGridCellRenderer):
def init(self, img):
wx.grid.PyGridCellRenderer.init(self)
self.img = img
def Draw(self, grid, attr, dc, rect, row, col, is_selected):
start = grid.GetViewStart()
pixel_start_pos = grid.CalcScrolledPosition(start[0],start[1])
image = wx.MemoryDC()
image.SelectObject(self.img)
dc.Blit(rect.x-1, rect.y, rect.width, rect.height, image,rect.x, rect.y+pixel_start_pos[1], wx.COPY, True)
def Clone(self):
return self.__class__()
On Monday, February 17, 2014 5:51:38 PM UTC+1, Stephane Ancelot wrote:
Hi,
Is there a way to setup a background image for wx.grid ???Regards,
Steph