8000 Add menu handler · matplotlib/matplotlib@5967c6f · GitHub
[go: up one dir, main page]

Skip to content

Commit 5967c6f

Browse files
Add menu handler
1 parent 1671be1 commit 5967c6f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/user_interfaces/mathtext_wx_sgskip.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ def __init__(self, parent, title):
6060

6161
# File Menu
6262
menu = wx.Menu()
63-
menu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Exit this simple sample")
63+
m_exit = menu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Exit this simple sample")
6464
menuBar.Append(menu, "&File")
65+
self.Bind(wx.EVT_MENU, self.OnClose, m_exit)
6566

6667
if IS_GTK or IS_WIN:
6768
# Equation Menu
@@ -112,6 +113,9 @@ def change_plot(self, plot_number):
112113
self.axes.plot(t, s)
113114
self.canvas.draw()
114115

116+
def OnClose(self, event):
117+
self.Destroy()
118+
115119

116120
class MyApp(wx.App):
117121
def OnInit(self):

0 commit comments

Comments
 (0)
0