Hi !
See this code:
#Boa:Frame:Frame1
import wx
import wx.grid
def create(parent):
return Frame1(parent)
[wxID_FRAME1, wxID_FRAME1GRID1,
] = [wx.NewId() for _init_ctrls in range(2)]
class Frame1(wx.Frame):
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
pos=wx.Point(346, 180), size=wx.Size(400, 479),
style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
self.SetClientSize(wx.Size(392, 445))
self.grid1 = wx.grid.Grid(id=wxID_FRAME1GRID1, name='grid1',
parent=self, pos=wx.Point(0, 0), size=wx.Size(392, 445), style=0)
self.grid1.Bind(wx.EVT_MOUSE_EVENTS, self.OnGrid1MouseEvents)
self.grid1.Bind(wx.EVT_LEFT_UP, self.OnGrid1LeftUp)
self.grid1.Bind(wx.EVT_MOTION, self.OnGrid1Motion)
def __init__(self, parent):
self._init_ctrls(parent)
self.grid1.CreateGrid(3,4)
def OnGrid1MouseEvents(self, event):
print "a"
event.Skip()
def OnGrid1LeftUp(self, event):
print "b"
event.Skip()
def OnGrid1Motion(self, event):
print "c"
event.Skip()
if __name__ == '__main__':
app = wx.PySimpleApp()
wx.InitAllImageHandlers()
frame = create(None)
frame.Show()
app.MainLoop()
When I started it, and do anything in grid (click, move the mouse), no one of the events fired.
I don't understand it, because I thinking as Delphi developer: in the inherited classes I can asscess, and redefine mouse clicks and moves.
But it seems to be that the click events are missed somewhere, only the grid click events have been remaining.
Or I thinking wrong ?
Thanx for help: ft