【发布时间】:2019-09-01 09:58:00
【问题描述】:
我有 python Tkinter 代码,我想在选项菜单中添加一个分隔符。我不知道该怎么做。
我在网上查过,但似乎还没有人问这个问题。
这里是代码
from tkinter import *
root = Tk()
root.geometry("1430x840")
# here is where I have the option menu. I want the separator in-between the word symbols and trash
var1 = StringVar()
opt1 = OptionMenu(root, var1,
'Mockups',
'Assets',
'Symbols',
# here is where the separator should be
'Trash')
opt1.pack(side=LEFT, anchor=W)
var1.set('')
root.mainloop()
【问题讨论】:
-
如果您的问题是关于选项菜单的,您应该删除所有与条目和框架相关的代码。 minimal reproducible example 应该有足够的代码来说明问题,但没有更多。
-
我知道,但我正在做一个在其中添加选项菜单分隔符的项目,但我添加了其余代码
-
现在怎么样了?
-
你能回答/帮助我解决我的问题吗?
标签: python macos tkinter pycharm