⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Spinbox
tkinter.Spinbox ( ).get ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Spinbox
tkinter.Spinbox ( ).get ( )
DESCRIPTION.
Retourne le texte actuellement dans la fenêtre d'une boite à choix.
SYNTAXE.
Choix = SPI_Choix.get ( )
Choix = ⇨ variable qui recevra la valeur [ optionnel ]
SPI_Choix ⇨ instance quelconque de tkinter.Spinbox ( ) [ OBLIGATOIRE ]
.get ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
REMARQUES.
Comme les valeurs entrées avec la méthode input ( ) de Python, celles retournées par la méthode tkinter.Spinbox ( ).get ( ) sont toujours de type str ( ), même si elles ne sont composées que de chiffres.
EXEMPLE.
import tkinter
def FNC_Traitement ( ) :
try :
LAB_Texte [ "text" ] = SPI_Choix.get ( )
LAB_Texte [ "background" ] = SPI_Choix.get ( )
except :
pass
TKI_Principal = tkinter.Tk ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter le programme" , command = TKI_Principal.destroy )
SPI_Choix = tkinter.Spinbox ( TKI_Principal , command = FNC_Traitement )
LAB_Texte = tkinter.Label ( TKI_Principal , relief = "solid" )
SPI_Choix.pack ( )
LAB_Texte.pack ( fill = "both" )
BUT_Quitter.pack ( fill = "both" )
SPI_Choix [ "values" ] = ( "red" , "lime" , "blue" , "yellow" , "magenta" , "aqua" , "black" , "white" )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de