]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxWave.py
A Unicode sample for wxPython
[wxWidgets.git] / wxPython / demo / wxWave.py
CommitLineData
493f1553
RD
1
2from wxPython.wx import *
6c5ae2d2 3from Main import opj
493f1553
RD
4
5#----------------------------------------------------------------------
6
7class TestPanel(wxPanel):
8 def __init__(self, parent):
9 wxPanel.__init__(self, parent, -1)
10
e5dd90b1
RD
11 b = wxButton(self, -1, "Play Sound 1", (25, 25))
12 EVT_BUTTON(self, b.GetId(), self.OnButton1)
493f1553 13
e5dd90b1
RD
14 b = wxButton(self, -1, "Play Sound 2", (25, 65))
15 EVT_BUTTON(self, b.GetId(), self.OnButton2)
493f1553 16
e5dd90b1
RD
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):
493f1553 27 try:
e5dd90b1 28 wave = wxWave(opj('data/plan.wav'))
493f1553
RD
29 wave.Play()
30 except NotImplementedError, v:
31 wxMessageBox(str(v), "Exception Message")
32
33
34#----------------------------------------------------------------------
35
36def runTest(frame, nb, log):
37 win = TestPanel(nb)
38 return win
39
40#----------------------------------------------------------------------
41
42
43overview = """\
44"""