Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在文本小部件上禁用I-Beam光标_Python_Python 3.x_Tkinter - Fatal编程技术网

Python 如何在文本小部件上禁用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

我正在尝试做一些文本冒险类的游戏,我正在使用一个文本小部件来显示文本。当我的光标悬停在文本小部件上时,它会变成一个I-Beam光标,可能是因为它想选择它。小部件被禁用,标志被关闭

如何关闭I-Beam光标以获得更愉快的体验

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上,还有一个名为“否”的;我听说过游标,但我不知道它对文本有效!谢谢大家