⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des méthodes
tkinter.option_clear ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des méthodes
tkinter.option_clear ( )
DESCRIPTION.
Rétablit toutes les valeurs par défaut des attributs des controles.
SYNTAXE.
widget.option_clear ( )
widget ⇨ controle quelconque de l'interface [ OBLIGATOIRE ]
.option_clear ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
REMARQUES.
La méthode tkinter.option_clear ( ) détruit toutes les entrées, entêtes et valeurs, de la base de données des options de tkinter. Ce qui a pour conséquence de rétablir toutes les valeurs par défaut des attributs des controles.
Par convention, on utilise la fenêtre créée avec tkinter.Tk ( ) pour l'utilisation de cette méthode.
EXEMPLE.
import tkinter , tkinter.font
TKI_Principal = tkinter.Tk ( )
FON_Boutons = tkinter.font.Font ( family = "times" , size = 24 , weight = "bold" )
BUT_Temoin = tkinter.Button ( TKI_Principal , text = "Temoin" )
TKI_Principal.option_add ( "*foreground" , "blue" )
TKI_Principal.option_add ( "*Button*font" , FON_Boutons )
TKI_Principal.option_add ( "*Button*relief" , "ridge" )
TKI_Principal.option_add ( "*Button*justify" , "right" )
TKI_Principal.option_add ( "*Button*borderWidth" , 11 )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
BUT_A = tkinter.Button ( TKI_Principal , text = "- Bouton A -" )
BUT_B = tkinter.Button ( TKI_Principal , text = "- Bouton B -" )
TKI_Principal.option_clear ( )
BUT_C = tkinter.Button ( TKI_Principal , text = "- Bouton C -" )
BUT_D = tkinter.Button ( TKI_Principal , text = "- Bouton D -" )
BUT_Temoin.pack ( )
BUT_A.pack ( )
BUT_B.pack ( )
BUT_C.pack ( )
BUT_D.pack ( )
BUT_Quitter.pack ( )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de