python - 如何在文本小部件上禁用 I-Beam 光标
问题描述
我正在尝试做一些文本冒险类的游戏,并且我正在使用文本小部件来显示文本。当我的光标悬停在文本小部件上时,它变成了 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"))
解决方案
推荐阅读
- performance - Jasypt - 在 Solaris 上性能不佳
- laravel - Laravel 5l 多数据库连接
- java - 看来 ImageView.setImageBitmap 不起作用
- javascript - 如何在javascript中压缩/简化/缩小数字数组
- scala - 如何使用火花数据框列来查找数组
- r - 如何在聚合数据上使用 quanteda?
- c# - 如何更改数据绑定列的单元格类型
- javascript - 如何使用映射渲染 Axios 函数的结果
- javascript - 在 React Native 中传递 props
- ibm-mq - 如何编写脚本来复制 IBM MQ MQExplorer 对象创建行为?