Skip to content

Commit 3950355

Browse files
committed
Documented the file menu and the help menu
1 parent 3b296ea commit 3950355

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

week-09/code/basic_app_4.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,35 @@ def __init__(self, app_logic, *args, **kwargs):
5656

5757
# Build up the menu bar:
5858
menuBar = wx.MenuBar()
59-
59+
60+
# Creating a file menu
6061
fileMenu = wx.Menu()
62+
63+
# Creating an Open option on the file menu.
6164
openMenuItem = fileMenu.Append(wx.ID_ANY, "&Open", "Open a file" )
6265
self.Bind(wx.EVT_MENU, self.onOpen, openMenuItem)
6366

67+
# Creating a Close option on the file menu
6468
closeMenuItem = fileMenu.Append(wx.ID_ANY, "&Close", "Close a file" )
6569
self.Bind(wx.EVT_MENU, self.onClose, closeMenuItem)
6670

71+
# Creating an Exit option on the file menu
6772
exitMenuItem = fileMenu.Append(wx.ID_EXIT, "Exit", "Exit the application")
6873
self.Bind(wx.EVT_MENU, self.onExit, exitMenuItem)
74+
75+
# The file menu goes on the menuBar
6976
menuBar.Append(fileMenu, "&File")
70-
77+
78+
# Create a help menu
7179
helpMenu = wx.Menu()
80+
81+
# The help menu has a single option, help.
7282
helpMenuItem = helpMenu.Append(wx.ID_HELP, "Help", "Get help")
83+
84+
# The help menu goes on the menuBar
7385
menuBar.Append(helpMenu, "&Help")
7486

87+
# The menuBar goes on the frame.
7588
self.SetMenuBar(menuBar)
7689

7790
## add just a single button:

0 commit comments

Comments
 (0)