⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ liste des attributs
tkinter.ttk.padding
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ liste des attributs
tkinter.ttk.padding
DESCRIPTION.
Définit, ou retourne, les marges à l'intérieur du controle.
SYNTAXE.
padding = marges
REMARQUES.
marges peut prendre la forme d'un tuple ( ) de :
- quatre éléments ( gauche , haut , droite , bas ) ;
- trois éléments ( gauche , haut&bas , droite ) ;
- deux éléments ( gauche&droite , haut&bas ) ;
- un élément ( marges ) ou marges.
Si les élément de marges sont des int ( ), ou des float ( ), les mesures sont exprimées en pixels (ex. 6 pour 6 pixels). Pour utiliser une autre unité de mesure, taille doit être un str ( ) contenant un nombre suivi d'un caractère précisant cette unité désirée:
- c, en centimètres (ex. "3c" pour 3 centimètres) ;
- m, en millimètres (ex. "7m" pour 7 multimètres) ;
- i, en pousses (inche) (ex. "4i" pour 4 pousses) ;
- p, en points d'impression (ex. "12p" pour 12 points).
EXEMPLE.
import tkinter , tkinter.ttk
TKI_Principal = tkinter.Tk ( )
tkinter.ttk .Button ( TKI_Principal , text = "Bouton 0" ).pack ( )
tkinter.ttk .Button ( TKI_Principal , text = "Bouton A" , padding = 4 ).pack ( )
tkinter.ttk .Button ( TKI_Principal , text = "Bouton B" , padding = ( 4 , 30 ) ).pack ( )
tkinter.ttk .Button ( TKI_Principal , text = "Bouton C" , padding = ( 4 , 30 , 18 ) ).pack ( )
tkinter.ttk .Button ( TKI_Principal , text = "Bouton D" , padding = ( 4 , 30 , 18 , 45 ) ).pack ( )
tkinter.ttk .Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy ).pack ( )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de