Created
March 19, 2013 23:33
-
-
Save fcwu/5201120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
class MainWindow(wx.Frame): | |
def __init__(self, parent, title): | |
wx.Frame.__init__(self, parent, title=title, size=(200,100)) | |
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE) | |
self.CreateStatusBar() # A Statusbar in the bottom of the window | |
# Setting up the menu. | |
filemenu= wx.Menu() | |
# wx.ID_ABOUT and wx.ID_EXIT are standard IDs provided by wxWidgets. | |
filemenu.Append(wx.ID_ABOUT, "&About"," Information about this program") | |
filemenu.AppendSeparator() | |
filemenu.Append(wx.ID_EXIT,"E&xit"," Terminate the program") | |
# Creating the menubar. | |
menuBar = wx.MenuBar() | |
menuBar.Append(filemenu,"&File") # Adding the "filemenu" to the MenuBar | |
self.SetMenuBar(menuBar) # Adding the MenuBar to the Frame content. | |
self.Show(True) | |
app = wx.App(False) | |
frame = MainWindow(None, "Sample editor") | |
app.MainLoop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment