]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/wxWave.py
corrections to dynamic loading for Darwin
[wxWidgets.git] / wxPython / demo / wxWave.py
... / ...
CommitLineData
1
2from wxPython.wx import *
3from Main import opj
4
5#----------------------------------------------------------------------
6
7class 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
29def runTest(frame, nb, log):
30 win = TestPanel(nb)
31 return win
32
33#----------------------------------------------------------------------
34
35
36overview = """\
37"""