# -*- coding: utf-8 -*-
import wx, os, sys
class MenuBarWindow(wx.Frame):
def __init__(self, parent, title):
# A "-1" in the size parameter instructs wxWidgets to use the default size.
# In this case, we select 200px width and the default height.
wx.Frame.__init__(self, parent, title=title, size=wx.DefaultSize)
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
# A StatusBar in the bottom of the window
self.CreateStatusBar()
# Setting up the menu.
filemenu = wx.Menu()
# wx.ID_ABOUT and wx.ID_EXIT are standard IDs provided by wxWidgets.
menuAbout = filemenu.Append(wx.ID_ABOUT, "About", " Information about this program")
menuOpen = filemenu.Append(wx.ID_OPEN, "Open", "Open a file to editor")
menuExit = filemenu.Append(wx.ID_EXIT, "Exit", " Terminate
python2.7练习 写一个简单的文本编辑器
最新推荐文章于 2024-03-09 10:57:39 发布
本文档展示了如何使用Python2.7和wxWidgets库创建一个简单的文本编辑器。编辑器包含文件菜单,支持打开、保存、退出操作,并在主窗口中显示文本。
摘要由CSDN通过智能技术生成