⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Font
tkinter.font.Font ( ).copy ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Font
tkinter.font.Font ( ).copy ( )
DEFINITION.
Créé un objet fonte indépendant en clonant les caractéristiques d'un autre objet fonte existant.
SYNTAXE.
FNT_Clone = FNT_Fonte.copy ( attribut1 = valeur , ... , attributn = valeur )
FNT_Clone = ⇨ création d'une instance de tkinter.font.Font ( ) [ OBLIGATOIRE ]
FNT_Fonte ⇨ instance quelconque de tkinter.font.Font ( ) [ OBLIGATOIRE ]
.copy ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
REMARQUES.
La méthode tkinter.font.Font.copy ( ) n'est pas native du module tkinter, il faut donc commencer par importer le module tkinter.font pour pouvoir utiliser cette méthode. Voir import pour plus de détails sur l'incorporation de modules, classes et méthodes non built-in dans un script.
La méthode tkinter.font.Font.copy ( ) ne détruit pas l'objet appelant. Les deux objets fontes sont distincts. Les modifications apportées à l'un des objets ne modifie l'autre objet.
EXEMPLE.
import tkinter
import tkinter.font
TKI_Principal = tkinter.Tk ( )
FNT_Test = tkinter.font.Font ( family = "Script" , size = 16 , underline = True )
FNT_Clone = tkinter.font.Font ( font = FNT_Test )
FNT_Clone.config ( size = 8 , slant = "italic" , underline = False )
tkinter.Label ( TKI_Principal , text = "FNT_Test" , font = FNT_Test ).pack ( )
tkinter.Label ( TKI_Principal , text = "FNT_Clone" , font = FNT_Clone ).pack ( )
tkinter.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