]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxWave.py
corrections to dynamic loading for Darwin
[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", (25, 25))
12 EVT_BUTTON(self, b.GetId(), self.OnButton)
13
14
15 def OnButton(self, evt):
16 try:
17 import time
18 if int(time.time()) % 2 == 1:
19 wave = wxWave(opj('data/anykey.wav'))
20 else:
21 wave = wxWave(opj('data/plan.wav'))
22 wave.Play()
23 except NotImplementedError, v:
24 wxMessageBox(str(v), "Exception Message")
25
26
27 #----------------------------------------------------------------------
28
29 def runTest(frame, nb, log):
30 win = TestPanel(nb)
31 return win
32
33 #----------------------------------------------------------------------
34
35
36 overview = """\
37 """