⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.spacing1
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.spacing1
DESCRIPTION.
Définit ou retourne l'espace à ajouter au dessus de chaque paragraphe dans l'éditeur de texte.
SYNTAXE.
spacing1 = taille
REMARQUES.
Si taille est un int ( ) 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).
Le comportement de cet attribut, peut varier selon la combinaison environnement utilisée.
EXEMPLE.
import tkinter
def FNC_Espace ( event ) :
TXT_Editeur [ "spacing1" ] = SCA_Dessus.get ( )
TXT_Editeur [ "spacing2" ] = SCA_Entre.get ( )
TXT_Editeur [ "spacing3" ] = SCA_Dessous.get ( )
TKI_Principal = tkinter.Tk ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
SCA_Dessus = tkinter.Scale ( TKI_Principal , orient = "horizontal" , to = 20 , command = FNC_Espace )
SCA_Entre = tkinter.Scale ( TKI_Principal , orient = "horizontal" , to = 20 , command = FNC_Espace )
SCA_Dessous = tkinter.Scale ( TKI_Principal , orient = "horizontal" , to = 20 , command = FNC_Espace )
TXT_Editeur = tkinter.Text ( TKI_Principal , wrap = "word" , width = 40 , height = 10 )
TXT_Editeur.grid ( row = 0 , column = 0 , columnspan = 3 , sticky = "nesw" )
tkinter.Label ( TKI_Principal , text = "Au dessus :" , justify = "right" ).grid ( row = 1 , column = 0 , sticky = "se" )
SCA_Dessus.grid ( row = 1 , column = 1 , sticky = "nesw" )
BUT_Quitter.grid ( row = 1 , column = 2 , rowspan = 3 , sticky = "nesw" )
tkinter.Label ( TKI_Principal , text = "Entre :" , justify = "right" ).grid ( row = 2 , column = 0 , sticky = "se" )
SCA_Entre.grid ( row = 2 , column = 1 , sticky = "nesw" )
tkinter.Label ( TKI_Principal , text = "Au dessous :" , justify = "right" ).grid ( row = 3 , column = 0 , sticky = "se" )
SCA_Dessous.grid ( row = 3 , column = 1 , sticky = "nesw" )
TXT_Editeur.insert ( "1.0" , "Python est un langage de programmation puissant et facile à apprendre. Il dispose de structures de données de haut niveau et permet une approche simple mais efficace de la programmation orientée objet." )
TXT_Editeur.insert ( "end + 1 line" , "\n\n" )
TXT_Editeur.insert ( "end + 1 line" , "Extrait de la documentation officielle." )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de