How to change text cursor color in Tkinter?

前端 未结 3 1722
臣服心动
臣服心动 2021-02-12 12:21

I have a text widget with dark background and I can\'t see the cursor\'s position. Is there any way to change the (blinking) text cursor\'s color?

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 12:57

    For python version 3

    import tkinter as tk
    
    textfield = tk.Entry(root)
    textfield.configure(bg="#1C6C0B", insertbackground='white')
    

提交回复
热议问题