1 编写一个导航栏

 

 1 from tkinter import *
 2 
 3 root = Tk()
 4 root.title("测试")
 5 root.geometry("400x400+400+200")
 6 root.resizable(width = False, height = False)
 7 
 8 def hello() :
 9     print("hello boy")
10 
11 menubar = Menu(root)
12 menubar.add_command(label = "hello", command = hello)
13 menubar.add_command(label = 'quit', command = root.quit)
14 
15 root.config(menu = menubar)
16 
17 root.mainloop() 
简例

相关文章:

  • 2021-12-16
  • 2021-12-18
  • 2021-08-31
  • 2021-05-29
  • 2022-12-23
  • 2021-04-28
  • 2021-12-03
猜你喜欢
  • 2021-08-20
  • 2021-06-02
  • 2021-06-14
  • 2021-05-30
  • 2021-07-02
相关资源
相似解决方案