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