⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Radiobutton
tkinter.Radiobutton ( ).deselect ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Radiobutton
tkinter.Radiobutton ( ).deselect ( )
DESCRIPTION.
Désélectionne, désactive, le bouton radio appelant.
SYNTAXE.
RAD_Choix.deselect ( )
RAD_Choix = ⇨ instance quelconque de tkinter.Radiobutton ( ) [ OBLIGATOIRE ]
.deselect ( ) = appel de la méthode [ OBLIGATOIRE ]
REMARQUES.
Si le bouton appelant n'est pas le bouton actif, sélectionné, de son groupe, l'appel de la méthode tkinter.Radiobutton ( ).deselect ( ) est ignoré.
Si le bouton appelant est le bouton actif, sélectionné, de son groupe, l'appel de la méthode tkinter.Radiobutton ( ).deselect ( ) modifiera la valeur de la variable de controle associée à son groupe. Cette nouvelle valeur varie en fonction du type de la variable de controle.
EXEMPLE.
import tkinter
def FNC_Action ( ) :
if TKV_Test.get ( ) == "Haut" : RAD_Choix1.deselect ( )
elif TKV_Test.get ( ) == "Centre" : RAD_Choix2.deselect ( )
elif TKV_Test.get ( ) == "Bas" : RAD_Choix3.deselect ( )
TKI_Principal = tkinter.Tk ( )
TKV_Test = tkinter.StringVar ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
BUT_Action = tkinter.Button ( TKI_Principal , text = "Désélectionner" , command = FNC_Action )
RAD_Choix1 = tkinter.Radiobutton ( TKI_Principal , text = "Haut" , value = "Haut" , variable = TKV_Test )
RAD_Choix2 = tkinter.Radiobutton ( TKI_Principal , text = "Centre" , value = "Centre" , variable = TKV_Test )
RAD_Choix3 = tkinter.Radiobutton ( TKI_Principal , text = "Bas" , value = "Bas" , variable = TKV_Test )
RAD_Choix1.pack ( )
RAD_Choix2.pack ( )
RAD_Choix3.pack ( )
BUT_Action.pack ( )
BUT_Quitter.pack ( )
TKV_Test.set ( "Centre" )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de