How to generate my own EVT_GRID_CELL_CHANGE event?

Yuan HOng hongyuan1306 at gmail.com
Tue Oct 3 08:11:44 PDT 2006


Hi,

I have a custom wx.Grid object. In one of its methods, I would like to
throw an EVT_GRID_CELL_CHANGE event after making some changes to the
grid table data, so that code bound to the event will be fired when
the method is called.

I placed the following code in the method:

  evt = wx.grid.GridEvent(self.GetId(),
wx.grid.wxEVT_GRID_CELL_CHANGE, self, r, c)
  wx.PostEvent(self, evt)

In the event handling method bound to the EVT_GRID_CELL_CHANGE event,
when I call event.GetRow() however, the program reports the following
error:

  AttributeError: 'NotifyEvent' object has no attribute 'GetRow'

How can I generate an EVT_GRID_CELL_CHANGE event that will be
correctly recognized by the event handling code?

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn


More information about the wxpython-users mailing list