-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexit.py
More file actions
55 lines (40 loc) · 1.42 KB
/
exit.py
File metadata and controls
55 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
"""
Name: Yoav Rozner
Version: 1.16
Description: Subprocess of the Bpm Finder which opens a window
to exit the song or the metronome.
"""
import wx
import wx.xrc
###########################################################################
## Class BpmFinderExit
###########################################################################
class BpmFinderExit(wx.Frame):
"""
Subprocess exit gui.
"""
def __init__(self, parent):
wx.Frame.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(169, 113),
style=wx.TAB_TRAVERSAL)
self.SetBackgroundColour(wx.Colour(128, 255, 0))
box_sizer1 = wx.BoxSizer(wx.VERTICAL)
self.exit = wx.Button(self, wx.ID_ANY, u"Exit", wx.DefaultPosition, wx.Size(200, 400), 0)
box_sizer1.Add(self.exit, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5)
self.SetSizer(box_sizer1)
self.Layout()
# Connect Events
self.exit.Bind(wx.EVT_BUTTON, self.exit_song)
# Virtual event handlers, override them in your derived class
def exit_song(self, event):
"""
Closes the subprocess on button click.
"""
raise SystemExit
def main():
app = wx.App(False)
f = BpmFinderExit(None)
f.Show()
app.MainLoop()
if __name__ == '__main__':
main()