⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.underline
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ liste des attributs
tkinter.underline
DESCRIPTION.
Définit ou retourne la position du caractère qui sera souligné dans le texte du controle.
SYNTAXE.
underline = index
REMARQUES.
index est un int ( ) correspondant à l'index du caractère à souligner. Si index est négatif, aucun caractère ne sera souligné. Pour rappel, le premier caractère du texte a pour index = 0.
EXEMPLE.
import tkinter
def FNC_Modifier ( Q ) :
kindex = LAB_Message [ "underline" ] + Q
LAB_Message [ "underline" ] = kindex
LAB_Message [ "text" ] = f"underline = { kindex }"
TKI_Principal = tkinter.Tk ( )
TKV_Message = tkinter.StringVar ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
BUT_Reculer = tkinter.Button ( TKI_Principal , text = "Reculer" , command = lambda : FNC_Modifier ( -1 ) )
BUT_Avancer = tkinter.Button ( TKI_Principal , text = "Avancer" , command = lambda : FNC_Modifier ( 1 ) )
LAB_Message = tkinter.Label ( TKI_Principal , font = ( None , 16 , "bold" ) )
LAB_Message.grid ( row = 0 , column = 0 , columnspan = 3 )
BUT_Reculer.grid ( row = 1 , column = 0 , sticky = "nesw" )
BUT_Avancer.grid ( row = 1 , column = 1 , sticky = "nesw" )
BUT_Quitter.grid ( row = 1 , column = 2 , sticky = "nesw" )
FNC_Modifier ( 0 )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de