Python3.4 GUI界面教程(菜单栏)

from tkinter import *def hello():print('hello')def about():label = Label(root, text='王小涛_同學\n QQ:*********', fg='red', bg='black')label.pack(expand=YES, fill=BOTH)root = Tk()menubar = Menu(root)filemenu = Menu(menubar, tearoff=0)filemenu.add_command(label='打开', command=hello)filemenu.add_command(label='保存')filemenu.add_separator()filemenu.add_command(label='退出', command=root.quit)menubar.add_cascade(label='文件', menu=filemenu)helpmenu = Menu(menubar, tearoff=0)helpmenu.add_command(label='关于作者', command=about)menubar.add_cascade(label='关于', menu=helpmenu)root.config(menu=menubar)root.geometry('200×400')root.mainloop()

,其实你已经错过了旅行的意义。

Python3.4 GUI界面教程(菜单栏)

相关文章:

你感兴趣的文章:

标签云: