- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change text cursor color in Tkinter?
Tkinter Entry and text widgets are used to create single and multiline text input fields. In order to change the color of the cursor, we can specify the insertbackground property by assigning the color of the cursor.
Example
In this example, we have created the text field and we have changed the color of the cursor by defining the insertbackground property.
#Import the tkinter library from tkinter import * #Create an instance of tkinter frame win= Tk() win.geometry("750x250") #Create a text field text= Text(win) text.configure(bg= 'SteelBlue3',insertbackground='red') text.pack() win.mainloop()
Output
Now, write something in the text field to see the reflected color of the cursor.
- Related Articles
- How to change the color of certain words in a Tkinter text widget?
- Change Cursor Color with CSS caret-color
- How to change the mouse pointer color in Tkinter?
- How to change the color of ttk button in Tkinter?
- How to Change Link Underline Color using text-decoration-color CSS
- How to change the background color of a Treeview in Tkinter?
- How to change the color of a Tkinter label programmatically?
- How to fully change the color of a Tkinter Listbox?
- How to change Tkinter label text on button press?
- How to make a Button Hover to change the Background Color in Tkinter?
- How to change the text color of an element in HTML?
- How to change the text color of Menu item in Android?
- How to change the Foreground Color of Text in C# Console?
- How to change the Background Color of Text in C# Console
- How to change spinner text size and text color in Android App using Kotlin?

Advertisements