For some reason, I can't use the Tkinter
or tkinter
module. After running the following command in the python shell
import Tkinter
原创...大约 1 分钟
For some reason, I can't use the Tkinter
or tkinter
module. After running the following command in the python shell
import Tkinter
你好,我是悦创。
我想你在学习 tkinter 的时候,会出现这个疑问:程序运行的时候菜单之下出现了一个虚线项。如下图:
点击这个虚线选项后,菜单单独浮于应用之上:
进查询发现了 tearoff 选项,当 tearoff=1
的时候该菜单被设置为可以独立出来的菜单,点击虚线就可以将菜单独立出来,当 tearoff=0
时就是正常的菜单了,但是默认情况下 tearoff=1
,所以在程序中需要设置一下: