from tkinter import *
import tkinter.messagebox
win = Tk()
win.config(bg='#87CEEB')
win.title("逻辑网")
win.geometry('450x350+300+200')
win.iconbitmap('../image/icon.ico')
def menuCommand():
tkinter.messagebox.showinfo("下拉菜单", "您正在使用下拉菜单功能")
mainmenu = Menu(win)
filemenu = Menu(mainmenu, tearoff=False)
filemenu.add_command(label="新建", command=menuCommand, accelerator="Ctrl+N")
filemenu.add_command(label="打开", command=menuCommand, accelerator="Ctrl+O")
filemenu.add_command(label="保存", command=menuCommand, accelerator="Ctrl+S")
filemenu.add_separator()
filemenu.add_command(label="退出", command=win.quit)
mainmenu.add_cascade(label="文件", menu=filemenu)
win.config(menu=mainmenu)
win.bind("<Control-n>", menuCommand)
win.bind("<Control-N>", menuCommand)
win.bind("<Control-o>", menuCommand)
win.bind("<Control-O>", menuCommand)
win.bind("<Control-s>", menuCommand)
win.bind("<Control-S>", menuCommand)
win.mainloop()