⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.highlightbackground
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.highlightbackground
DESCRIPTION.
Définit ou retourne la couleur de la surbrillance quand le controle n'a pas le focus.
SYNTAXE.
highlightbackground = couleur
REMARQUES.
couleur doit être un str ( ) représentant une couleur valide. Par défaut couleur vaut "#D9D9D9".
Par exemple pour les couleurs les plus courantes :
- noir : highlightbackground = "black" ;
- rouge : highlightbackground = "red" ;
- vert citron : highlightbackground = "lime" ;
- jaune : highlightbackground = "yellow" ;
- bleu : highlightbackground = "blue" ;
- fushia : highlightbackground = "magenta" ;
- cyan : highlightbackground = "aqua" ;
- blanc : highlightbackground = "white" ;
- marron : highlightbackground = "maroon" ;
- vert : highlightbackground = "green" ;
- bleu marine : highlightbackground = "navy" ;
- olive : highlightbackground = "olive" ;
- violet : highlightbackground = "purple" ;
- sarcelle : highlightbackground = "teal" ;
- gris : highlightbackground = "gray" ;
- argent : highlightbackground = "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" , highlightbackground = "white" ).grid ( row = 0 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Noir" , highlightbackground = "black" ).grid ( row = 0 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Rouge" , highlightbackground = "red" ).grid ( row = 0 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Vert citron" , highlightbackground = "lime" ).grid ( row = 0 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Bleu" , highlightbackground = "blue" ).grid ( row = 1 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Cyan" , highlightbackground = "aqua" ).grid ( row = 1 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Fushia" , highlightbackground = "magenta" ).grid ( row = 1 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Jaune" , highlightbackground = "yellow" ).grid ( row = 1 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Marron" , highlightbackground = "maroon" ).grid ( row = 2 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Vert" , highlightbackground = "green" ).grid ( row = 2 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Bleu marine" , highlightbackground = "navy" ).grid ( row = 2 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Olive" , highlightbackground = "olive" ).grid ( row = 2 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Violet" , highlightbackground = "purple" ).grid ( row = 3 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Sarcelle" , highlightbackground = "teal" ).grid ( row = 3 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Gris" , highlightbackground = "gray" ).grid ( row = 3 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Argent" , highlightbackground = "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