]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxWave.py
2 from wxPython
.wx
import *
5 #----------------------------------------------------------------------
7 class TestPanel(wxPanel
):
8 def __init__(self
, parent
):
9 wxPanel
.__init
__(self
, parent
, -1)
11 b
= wxButton(self
, -1, "Play Sound 1", (25, 25))
12 EVT_BUTTON(self
, b
.GetId(), self
.OnButton1
)
14 b
= wxButton(self
, -1, "Play Sound 2", (25, 65))
15 EVT_BUTTON(self
, b
.GetId(), self
.OnButton2
)
18 def OnButton1(self
, evt
):
20 wave
= wxWave(opj('data/anykey.wav'))
22 except NotImplementedError, v
:
23 wxMessageBox(str(v
), "Exception Message")
26 def OnButton2(self
, evt
):
28 wave
= wxWave(opj('data/plan.wav'))
30 except NotImplementedError, v
:
31 wxMessageBox(str(v
), "Exception Message")
34 #----------------------------------------------------------------------
36 def runTest(frame
, nb
, log
):
40 #----------------------------------------------------------------------