⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des méthodes
tkinter.tk_focusNext ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des méthodes
tkinter.tk_focusNext ( )
DESCRIPTION.
Retourne l'identifiant du controle qui aura le focus ensuite.
SYNTAXE.
IDE_Objet = widget.tk_focusNext ( )
IDE_Objet = ⇨ variable qui recevra la valeur [ optionnel ]
widget ⇨ controle quelconque de l'interface [ OBLIGATOIRE ]
.tk_focusNext ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
REMARQUE.
Par convention, on utilise la fenêtre créée avec tkinter.Tk ( ) pour l'utilisation de cette méthode.
EXEMPLE.
import tkinter
def FNC_Focus ( ) :
TKI_Principal.tk_focusFollowsMouse ( )
LAB_Precedent [ "text" ] = f"Avant : { TKI_Principal.tk_focusPrev ( ) }."
LAB_Actuel [ "text" ] = f"Actuel : { TKI_Principal.focus_get ( ) }."
LAB_Suivant [ "text" ] = f"Ensuite : { TKI_Principal.tk_focusNext ( ) }."
TKI_Principal.after ( 100 , FNC_Focus )
TKI_Principal = tkinter.Tk ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
BUT_BoutonA = tkinter.Button ( TKI_Principal , text = "Bouton A" )
BUT_BoutonB = tkinter.Button ( TKI_Principal , text = "Bouton B" )
BUT_BoutonC = tkinter.Button ( TKI_Principal , text = "Bouton c" )
ENT_SaisieA = tkinter.Entry ( TKI_Principal )
ENT_SaisieB = tkinter.Entry ( TKI_Principal )
LAB_Precedent = tkinter.Label ( TKI_Principal , text = "Avant" )
LAB_Actuel = tkinter.Label ( TKI_Principal , text = "Actuel" )
LAB_Suivant = tkinter.Label ( TKI_Principal , text = "Ensuite" )
LAB_Precedent.pack ( )
LAB_Actuel.pack ( )
LAB_Suivant.pack ( )
ENT_SaisieA.pack ( )
BUT_BoutonA.pack ( )
BUT_BoutonB.pack ( )
ENT_SaisieB.pack ( )
BUT_BoutonC.pack ( )
BUT_Quitter.pack ( )
TKI_Principal.after ( 100 , FNC_Focus )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de