⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Scale
tkinter.Scale ( ).get ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Scale
tkinter.Scale ( ).get ( )
DESCRIPTION.
Retourne la valeur actuellement sélectionnée sur une échelle de valeurs.
SYNTAXE.
Valeur = SCA_Echelle.get ( )
Valeur = ⇨ variable qui recevra la valeur [ optionnel ]
SCA_Echelle = ⇨ instance de quelconque de tkinter.Scale ( ) [ OBLIGATOIRE ]
.get ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
EXEMPLE.
import tkinter
def FNC_Calcul ( event ) :
kmessage = f"Table x : { SCA_Table.get ( ) } ...\n"
for kvaleur in range ( 10 ) : kmessage += f"{ SCA_Table.get ( ) } x { kvaleur } = { SCA_Table.get ( ) * kvaleur }\n"
LAB_Calcul [ "text" ] = kmessage
TKI_Principal = tkinter.Tk ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
SCA_Table = tkinter.Scale ( TKI_Principal , command = FNC_Calcul )
LAB_Calcul = tkinter.Label ( TKI_Principal )
BUT_Quitter.pack ( side = "bottom" , fill = "both" )
LAB_Calcul.pack ( side = "right" , fill = "both" )
SCA_Table.pack ( side = "left" , fill = "both" )
FNC_Calcul ( None )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de