⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.activeforeground
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.activeforeground
DESCRIPTION.
Définit ou retourne la couleur du premier plan (texte) lorsque le pointeur est sur le controle.
SYNTAXE.
activeforeground = 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 : activeforeground = "black" ;
- rouge : activeforeground = "red" ;
- vert citron : activeforeground = "lime" ;
- jaune : activeforeground = "yellow" ;
- bleu : activeforeground = "blue" ;
- fushia : activeforeground = "magenta" ;
- cyan : activeforeground = "aqua" ;
- blanc : activeforeground = "white" ;
- marron : activeforeground = "maroon" ;
- vert : activeforeground = "green" ;
- bleu marine : activeforeground = "navy" ;
- olive : activeforeground = "olive" ;
- violet : activeforeground = "purple" ;
- sarcelle : activeforeground = "teal" ;
- gris : activeforeground = "gray" ;
- argent : activeforeground = "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" , activeforeground = "white" ).grid ( row = 0 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Noir" , activeforeground = "black" ).grid ( row = 0 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Rouge" , activeforeground = "red" ).grid ( row = 0 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Vert citron" , activeforeground = "lime" ).grid ( row = 0 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Bleu" , activeforeground = "blue" ).grid ( row = 1 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Cyan" , activeforeground = "aqua" ).grid ( row = 1 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Fushia" , activeforeground = "magenta" ).grid ( row = 1 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Jaune" , activeforeground = "yellow" ).grid ( row = 1 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Marron" , activeforeground = "maroon" ).grid ( row = 2 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Vert" , activeforeground = "green" ).grid ( row = 2 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Bleu marine" , activeforeground = "navy" ).grid ( row = 2 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Olive" , activeforeground = "olive" ).grid ( row = 2 , column = 3 )
tkinter.Button ( TKI_Principal , text = "Violet" , activeforeground = "purple" ).grid ( row = 3 , column = 0 )
tkinter.Button ( TKI_Principal , text = "Sarcelle" , activeforeground = "teal" ).grid ( row = 3 , column = 1 )
tkinter.Button ( TKI_Principal , text = "Gris" , activeforeground = "gray" ).grid ( row = 3 , column = 2 )
tkinter.Button ( TKI_Principal , text = "Argent" , activeforeground = "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