[[wxPython] Newbie Q: Redrawing wxGrid cells.]

cspence@genie.co.uk wrote:

I have code like this to update a cell in a wxGrid using a custom
table:

class MyGrid(wxGrid):
  def __init__(self):
    ---snip---
    self.table=MywxPythonTableBase()
    ---snip---

  def OnKeyDown(self, evt)
    ---snip---
    self.table.SetValue(row,col, number)
    ---snip---

How to I tell wxPython to update the display of the grid cell having
changed it's value?

use somthing like this:

# tell the grid we've changed all
msg = wxGridTableMessage(self.table, # The table
               wxGRIDTABLE_REQUEST_VIEW_GET_VALUES, # what we did to it
               1) # how many

self.table.GetView().ProcessTableMessage(msg)

Niki Spahiev
e-mail: niki@vintech.bg

···

____________________________________________________________________
Get free email and a permanent address at Net@ddress Mail