]> git.saurik.com Git - wxWidgets.git/blame - wxPython/tests/test_dclick.py
typo fix
[wxWidgets.git] / wxPython / tests / test_dclick.py
CommitLineData
0b0849b5
RD
1import wx
2
3def OnClick(evt):
4 print 'Click'
5
6def OnDClick(evt):
7 print 'DClick'
8
9def OnMouse(evt):
10 if evt.LeftDClick():
11 print 'DClick'
12 elif evt.LeftDown():
13 print 'Click'
14
15app = wx.App(redirect=False)
16frame = wx.Frame(None, title="Test mouse clicks")
17panel = wx.Panel(frame)
18
19if True:
20 # try separate
21 panel.Bind(wx.EVT_LEFT_DOWN, OnClick)
22 panel.Bind(wx.EVT_LEFT_DCLICK, OnDClick)
23else:
24 # or together
25 panel.Bind(wx.EVT_MOUSE_EVENTS, OnMouse)
26
27frame.Show()
28app.MainLoop()