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