⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.highlightcolor
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.highlightcolor
DESCRIPTION.
Définit ou retourne la couleur de la surbrillance quand le controle a le focus.
SYNTAXE.
highlightcolor = couleur
REMARQUES.
couleur doit être un str ( ) représentant une couleur valide. Par défaut couleur vaut "#000000" ("black").
Par exemple pour les couleurs les plus courantes :
- noir : highlightcolor = "black" ;
- rouge : highlightcolor = "red" ;
- vert citron : highlightcolor = "lime" ;
- jaune : highlightcolor = "yellow" ;
- bleu : highlightcolor = "blue" ;
- fushia : highlightcolor = "magenta" ;
- cyan : highlightcolor = "aqua" ;
- blanc : highlightcolor = "white" ;
- marron : highlightcolor = "maroon" ;
- vert : highlightcolor = "green" ;
- bleu marine : highlightcolor = "navy" ;
- olive : highlightcolor = "olive" ;
- violet : highlightcolor = "purple" ;
- sarcelle : highlightcolor = "teal" ;
- gris : highlightcolor = "gray" ;
- argent : highlightcolor = "argent" ;
Le comportement de cet attribut, peut varier selon la combinaison controle / environnement utilisée. Il peut même, dans certain cas, être ignoré. Voir les couleurs avec tkinter pour plus de d'informations sur la désignation des couleurs.
EXEMPLE.
import tkinter
TKI_Principal = tkinter.Tk ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
BUT_Quitter.grid ( row = 4 , column = 0 , columnspan = 4 , sticky = "nesw" )
tkinter.Button ( TKI_Principal , text = "Blanc" , highlightcolor = "white" ).grid ( row = 0 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Noir" , highlightcolor = "black" ).grid ( row = 0 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Rouge" , highlightcolor = "red" ).grid ( row = 0 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Vert citron" , highlightcolor = "lime" ).grid ( row = 0 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Bleu" , highlightcolor = "blue" ).grid ( row = 1 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Cyan" , highlightcolor = "aqua" ).grid ( row = 1 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Fushia" , highlightcolor = "magenta" ).grid ( row = 1 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Jaune" , highlightcolor = "yellow" ).grid ( row = 1 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Marron" , highlightcolor = "maroon" ).grid ( row = 2 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Vert" , highlightcolor = "green" ).grid ( row = 2 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Bleu marine" , highlightcolor = "navy" ).grid ( row = 2 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Olive" , highlightcolor = "olive" ).grid ( row = 2 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Violet" , highlightcolor = "purple" ).grid ( row = 3 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Sarcelle" , highlightcolor = "teal" ).grid ( row = 3 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Gris" , highlightcolor = "gray" ).grid ( row = 3 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Argent" , highlightcolor = "silver" ).grid ( row = 3 , column = 3 )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de