⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Radiobutton
tkinter.Radiobutton ( ).invoke ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Radiobutton
tkinter.Radiobutton ( ).invoke ( )
DESCRIPTION.
Invoque, appel, la même méthode que celle associée au bouton radio appelant.
SYNTAXE.
RAD_Choix.invoke ( )
RAD_Choix = ⇨ instance quelconque de tkinter.Radiobutton ( ) [ OBLIGATOIRE ]
.invoke ( ) = appel de la méthode [ OBLIGATOIRE ]
REMARQUE.
Si aucune fonction n'est associée au controle appelant, l'appel de la méthode tkinter.Radiobuton ( ).invoke ( ) est ignoré.
EXEMPLE.
import tkinter
def FNC_Calcul ( ) :
TKV_Resultat.set ( TKV_Resultat.get ( ) + TKV_Valeur.get ( ) )
def FNC_Triple ( ) :
RAD_Un.invoke ( )
RAD_Deux.invoke ( )
TKI_Principal = tkinter.Tk ( )
TKV_Valeur = tkinter.IntVar ( )
TKV_Resultat = tkinter.IntVar ( )
RAD_Un = tkinter.Radiobutton ( TKI_Principal , text = "+ 1" , value = 1 , variable = TKV_Valeur , command = FNC_Calcul )
RAD_Deux = tkinter.Radiobutton ( TKI_Principal , text = "+ 2" , value = 2 , variable = TKV_Valeur , command = FNC_Calcul )
RAD_Cinq = tkinter.Radiobutton ( TKI_Principal , text = "+ 5" , value = 5 , variable = TKV_Valeur , command = FNC_Calcul )
RAD_Dix = tkinter.Radiobutton ( TKI_Principal , text = "+ 10" , value = 10 , variable = TKV_Valeur , command = FNC_Calcul )
RAD_Un.pack ( )
RAD_Deux.pack ( )
RAD_Cinq.pack ( )
RAD_Dix.pack ( )
tkinter.Label ( TKI_Principal , textvariable = TKV_Resultat ).pack ( pady = 4 )
tkinter.Button ( TKI_Principal , text = "Ajouter 3" , command = FNC_Triple ).pack ( pady = 4 )
tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy ).pack ( pady = 4 )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de