L'option insertbackground du widget Text Tkinter définit la couleur du curseur. La couleur par défaut est noire si l'option est ignorée.
Exemple
1 2 3 4 5 6 7 8 9 |
# coding: utf-8 from tkinter import * root= Tk() root.geometry("400x300") T = Text(root , height = 10 , width = 30 , insertbackground="red") T.insert(1.0, "Insertbackground Text tkinter ") T.pack() root.mainloop() |
Maintenant si vous exécutez le code et vous faite apparaitre le curseur à l'aide d'un click sur le widget Text, vous allez constater que ce dernier clignote en prenant une couleur rouge:
Younes Derfoufi
CRMEF OUJDA
Acheter sur Très Facile !
-
Python Programming Step-By-Step : Python Object-Oriented Programming
€ 13,00 Buy Now -
Routeur Tenda avec Carte SIM 4G09 AC1200 Bi- bandd 4G + Cat6 300Mbps, Connectivité Jusqu'à 64 Appareils
€ 89,00 Acheter le produit -
Débutant en Python : Programmer un réseau neuronal en 7 jours
€ 17,00 Acheter le livre
1 thought on “L'option insertbackground d'un widget Text Tkinter”