⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.disabledforeground
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.disabledforeground
DESCRIPTION.
Définit ou retourne la couleur du premier plan (texte) lorsque le controle est désactivé.
SYNTAXE.
disabledforeground = couleur
REMARQUES.
couleur doit être un str ( ) représentant une couleur valide. Par défaut couleur vaut "#A3A3A3".
Par exemple pour les couleurs les plus courantes :
- noir : disabledforeground = "black" ;
- rouge : disabledforeground = "red" ;
- vert citron : disabledforeground = "lime" ;
- jaune : disabledforeground = "yellow" ;
- bleu : disabledforeground = "blue" ;
- fushia : disabledforeground = "magenta" ;
- cyan : disabledforeground = "aqua" ;
- blanc : disabledforeground = "white" ;
- marron : disabledforeground = "maroon" ;
- vert : disabledforeground = "green" ;
- bleu marine : disabledforeground = "navy" ;
- olive : disabledforeground = "olive" ;
- violet : disabledforeground = "purple" ;
- sarcelle : disabledforeground = "teal" ;
- gris : disabledforeground = "gray" ;
- argent : disabledforeground = "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'information 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.pack ( side = "bottom" )
tkinter.Label ( TKI_Principal , text = "Noir" , disabledforeground = "black" , state = "disabled" ).pack ( )
tkinter.Label ( TKI_Principal , text = "Rouge" , disabledforeground = "red" , state = "disabled" ).pack ( )
tkinter.Label ( TKI_Principal , text = "Vert citron" , disabledforeground = "lime" , state = "disabled" ).pack ( )
tkinter.Label ( TKI_Principal , text = "Bleu" , disabledforeground = "blue" , state = "disabled" ).pack ( )
tkinter.Label ( TKI_Principal , text = "Cyan" , disabledforeground = "aqua" , state = "disabled" ).pack ( )
tkinter.Label ( TKI_Principal , text = "Fushia" , disabledforeground = "magenta" , state = "disabled" ).pack ( )
tkinter.Label ( TKI_Principal , text = "Jaune" , disabledforeground = "yellow" , state = "disabled" ).pack ( )
tkinter.Label ( TKI_Principal , text = "Vert" , disabledforeground = "green" , state = "disabled" ).pack ( )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de