]>
Commit | Line | Data |
---|---|---|
493f1553 RD |
1 | |
2 | from wxPython.wx import * | |
6c5ae2d2 | 3 | from Main import opj |
493f1553 RD |
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: | |
6c5ae2d2 | 19 | wave = wxWave(opj('data/anykey.wav')) |
493f1553 | 20 | else: |
6c5ae2d2 | 21 | wave = wxWave(opj('data/plan.wav')) |
493f1553 RD |
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 | """ |