]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxWave.py
swigged code update for wxMac
[wxWidgets.git] / wxPython / demo / wxWave.py
1
2 from wxPython.wx import *
3 from Main import opj
4
5 #----------------------------------------------------------------------
6
7 class TestPanel(wxPanel):
8 def __init__(self, parent):
9 wxPanel.__init__(self, parent, -1)
10
11 b = wxButton(self, -1, "Play Sound 1", (25, 25))
12 EVT_BUTTON(self, b.GetId(), self.OnButton1)
13
14 b = wxButton(self, -1, "Play Sound 2", (25, 65))
15 EVT_BUTTON(self, b.GetId(), self.OnButton2)
16
17
18 def OnButton1(self, evt):
19 try:
20 wave = wxWave(opj('data/anykey.wav'))
21 wave.Play()
22 except NotImplementedError, v:
23 wxMessageBox(str(v), "Exception Message")
24
25
26 def OnButton2(self, evt):
27 try:
28 wave = wxWave(opj('data/plan.wav'))
29 wave.Play()
30 except NotImplementedError, v:
31 wxMessageBox(str(v), "Exception Message")
32
33
34 #----------------------------------------------------------------------
35
36 def runTest(frame, nb, log):
37 win = TestPanel(nb)
38 return win
39
40 #----------------------------------------------------------------------
41
42
43 overview = """\
44 """