wxGrid bvackground colours, repainting/refreshing.

G'day All,
I have a wxGrid in which I am doing some processing on each row/line.

I was hoping I could change the background colours of the cells as they are read and processed.
I did this by just putting this

self.grid.SetCellBackgroundColour(row,col,MYgrey)
self.grid.ForceRefresh()

after each cell was processed successfully

The problem is the window/grid/cells aren't actaully repainted with the new
background colours until the mouse triggers an even on the grid,
so the effect is not really what I had hoped for.

Is there a way to implement this, what is wrong with the logic?

TIA

···

--
---Gareth Walters System Administrator/IT support
Micro Forté -- http://www.microforte.com.au http://www.bigworldtech.com

***********************************************************************
This information may contain PRIVILEGED AND CONFIDENTIAL information intended only for the use of the addressee(s). Anyone who receives this communication in error, should notify us immediately and destroy the original message without reading, copying or forwarding it to anyone.
***********************************************************************

Gareth Walters wrote:

G'day All,
I have a wxGrid in which I am doing some processing on each row/line.

I was hoping I could change the background colours of the cells as they are read and processed.
I did this by just putting this

self.grid.SetCellBackgroundColour(row,col,MYgrey)
self.grid.ForceRefresh()

after each cell was processed successfully

The problem is the window/grid/cells aren't actaully repainted with the new
background colours until the mouse triggers an even on the grid,
so the effect is not really what I had hoped for.

Do you have any BeginBatch calls that havn't yet had a matching EndBatch call? ForceRefresh doesn't do anything if batch processing is active. If that doesn't help then you could try doing this instead:

  self.grid.GetGridWindow().Refresh()

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!