Python学习实例:编写一个记事本GUI
来源:互联网 发布:家长监控软件 编辑:程序博客网 时间:2024/06/05 06:32
#!/usr/bin/env python#-*- coding:utf-8 -*-from Tkinter import *def donothing():filewin=Toplevel(root)button=Button(filewin,text="hi 这是菜单响应代码段")button.pack()root=Tk()root.title("记事本")root.geometry("800x500")menubar=Menu(root)filemenu = Menu(menubar, tearoff=0)filemenu=Menu(menubar,tearoff=0)filemenu.add_command(label="新建",accelerator="Ctrl+N",command=donothing)filemenu.add_command(label="打开",accelerator="Ctrl+O",command=donothing)filemenu.add_command(label="保存",accelerator="Ctrl+S",command=donothing)filemenu.add_command(label="另存为",accelerator="Ctrl+Shift+S",command=donothing)filemenu.add_separator()filemenu.add_command(label="页面设置",accelerator="U",command=donothing)filemenu.add_command(label="打印",accelerator="Ctrl+P",command=donothing)filemenu.add_separator()filemenu.add_command(label="退出",accelerator="X",command=root.quit)menubar.add_cascade(label="文件",menu=filemenu)editmenu = Menu(menubar, tearoff=0)editmenu.add_command(label="Undo", command=donothing)editmenu.add_separator()editmenu.add_command(label="Cut", command=donothing)editmenu.add_command(label="Copy", command=donothing)editmenu.add_command(label="Paste", command=donothing)editmenu.add_command(label="Delete", command=donothing)editmenu.add_command(label="Select All", command=donothing)menubar.add_cascade(label="Edit", menu=editmenu)helpmenu = Menu(menubar, tearoff=0)helpmenu.add_command(label="Help Index", command=donothing)helpmenu.add_command(label="About...", command=donothing)menubar.add_cascade(label="Help", menu=helpmenu)root.config(menu=menubar)txt=Text(root,undo=True)txt.pack(expand=YES,fill=BOTH)scl=Scrollbar(txt)txt.config(yscrollcommand=scl.set)scl.config(command=txt.yview())scl.pack(side=RIGHT,fill=Y)statusbar=Label(root,text="行 1 column 1",bg="#fff",fg="#00c",relief=SUNKEN,anchor=E)statusbar.pack(side=BOTTOM,fill=X)if __name__ == "__main__":mainloop()
0 0
- Python学习实例:编写一个记事本GUI
- java gui编写记事本
- python GUI编程——wxpython编写简单记事本程序
- java GUI(实例项目--记事本)
- java编写一个简单记事本
- python编写GUI
- [初学Python]学习如何编写GUI界面(初级)
- JAVA基础 day24 GUI的学习 事件监听机制 编写简易的记事本 jar包双击执行
- python GUI 实例
- 用java编写一个记事本的心得
- 用Java编写的一个小记事本
- 编写一个类似记事本的菜单
- python使用Tkinter编写GUI
- Python-GUI编程之 Tkinter 与 记事本实现心得
- 编写记事本
- Python 图形界面 GUI Tkinter 实例
- Python Gui 学习 Tkinter
- Python Gui 学习 Tkinter
- [引言]学习编程技术需要的基本条件
- js关于省市的二级下拉菜单联动
- [LeetCode]045-Jump Game II
- Java多线程之ThreadPoolExecutor
- 综合案例建模--失物招领管理系统的模型
- Python学习实例:编写一个记事本GUI
- 工作总结2-代码规范问题
- Dagger 2 before
- 假如从来没有开始,你怎么知道自己会不会很爱很爱那个人呢
- js中 关于复选框的多选和反选
- jquery的height()和javascript的height总结,js获取屏幕高度
- NSOperation的基本使用
- Python3.4 安装Numpy
- Lua封装打印Table函数