Python 如何在文本小部件上禁用I-Beam光标
我正在尝试做一些文本冒险类的游戏,我正在使用一个文本小部件来显示文本。当我的光标悬停在文本小部件上时,它会变成一个I-Beam光标,可能是因为它想选择它。小部件被禁用,标志被关闭 如何关闭I-Beam光标以获得更愉快的体验Python 如何在文本小部件上禁用I-Beam光标,python,python-3.x,tkinter,Python,Python 3.x,Tkinter,我正在尝试做一些文本冒险类的游戏,我正在使用一个文本小部件来显示文本。当我的光标悬停在文本小部件上时,它会变成一个I-Beam光标,可能是因为它想选择它。小部件被禁用,标志被关闭 如何关闭I-Beam光标以获得更愉快的体验 window=Tk() window.resizable(width=False, height=False) window.title("Text Adventure") txt=Text(window, font=("Comic Sans", 44), bg="Blac
window=Tk()
window.resizable(width=False, height=False)
window.title("Text Adventure")
txt=Text(window, font=("Comic Sans", 44), bg="Black", fg="white", width=width-100, borderwidth=0, wrap=WORD, exportselection=0)
txt.tag_configure('center', justify='center')
txt.insert('end', text, 'center')
txt.config(state=DISABLED)
txt.pack()
answer=Entry(window, font=("Comic Sans", 20), bg="Black", fg="Red", borderwidth=0, disabledbackground="Black", disabledforeground="Red", exportselection=0)
answer.place(x=(width/2)-ewidth/2, width=ewidth, height=eheight, y=height-eheight*8)
txt.bindtags((str(txt), str(window), "all"))
answer.bindtags((str(answer), str(window), "all"))
有一个
cursor=
选项,请阅读并尝试设置cursor=None
。从中选择:“可以指定无光标以消除光标”。在Windows上,还有一个名为“否”的;我听说过游标,但我不知道它对文本有效!谢谢大家