Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5967c6f

Browse filesBrowse files
Add menu handler
1 parent 1671be1 commit 5967c6f
Copy full SHA for 5967c6f

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎examples/user_interfaces/mathtext_wx_sgskip.py

Copy file name to clipboardExpand all lines: examples/user_interfaces/mathtext_wx_sgskip.py
+5-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.