-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample03.py
More file actions
35 lines (25 loc) · 1019 Bytes
/
Copy pathSample03.py
File metadata and controls
35 lines (25 loc) · 1019 Bytes
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
import wx
class MyFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self,parent,title=title, size=(400,500))
self.control = wx.TextCtrl(self, style = wx.TE_MULTILINE)
self.CreateStatusBar() #the status bar in the bottom
menuBar = wx.MenuBar()
testMenu = wx.Menu()
menuOnce = testMenu.Append(wx.ID_ANY, "Once", "print something")
menuTwice = testMenu.Append(wx.ID_ANY, "Twice", "print something and another thing")
menuBar.Append(testMenu, "Test")
self.Bind(wx.EVT_MENU, self.First, menuOnce)
self.Bind(wx.EVT_MENU, self.First, menuTwice)
self.Bind(wx.EVT_MENU, self.Second, menuTwice)
self.SetMenuBar(menuBar)
self.Show(True)
def First(self, event):
print("something")
event.Skip()
def Second(self, event):
print("another thing")
event.Skip()
app = wx.App(False) #what does False mean?
frame = MyFrame(None, 'Small editor')
app.MainLoop()