⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ PanedWindow
tkinter.PanedWindow ( ).sash_place ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ PanedWindow
tkinter.PanedWindow ( ).sash_place ( )
DESCRIPTION.
Modifie les coordonnées d'une ligne de séparation du bandeau.
SYNTAXE.
FRM_Bandeau.sash_place ( index , abscisse , ordonnee )
FRM_Bandeau ⇨ instance de tkinter.PanedWindow ( ) [ OBLIGATOIRE ]
.sash_coord ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
index ⇨ index de la ligne de séparation [ OBLIGATOIRE ]
abscisse ⇨ abscisse du point de référence [ OBLIGATOIRE ]
ordonnee ⇨ ordonnée du point de référence [ OBLIGATOIRE ]
REMARQUES.
index est un int ( ) indiquant une ligne de séparation, valide, du bandeau.
abscisse est un int ( ) ou float ( ) exprimé en pixels, il indique la distance entre le point de référence et la bordure gauche du bandeau de controles.
ordonne est un int ( ) ou float ( ) exprimé en pixels, il indique la distance entre le point de référence et la bordure haute du bandeau de controles.
EXEMPLE.
import tkinter
def FNC_Bouger ( Q ) :
if Q == "a" :
FRM_Bandeau.sash_place ( 0 , SCA_Ligne_A.get ( ) , 0 )
LAB_Ligne_A [ "text" ] = FRM_Bandeau.sash_coord ( 0 )
elif Q == "b" :
FRM_Bandeau.sash_place ( 2 , SCA_Ligne_B.get ( ) , 0 )
LAB_Ligne_B [ "text" ] = FRM_Bandeau.sash_coord ( 2 )
else :
FRM_Bandeau.sash_place ( 4 , SCA_Ligne_C.get ( ) , 0 )
LAB_Ligne_C [ "text" ] = FRM_Bandeau.sash_coord ( 4 )
TKI_Principal = tkinter.Tk ( )
FRM_Bandeau = tkinter.PanedWindow ( TKI_Principal , sashrelief = "ridge" )
BUT_Quitter = tkinter.Button ( FRM_Bandeau , text = "Quitter" , command = TKI_Principal.destroy )
SCA_Ligne_A = tkinter.Scale ( FRM_Bandeau , command = lambda event : FNC_Bouger ( "a" ) )
SCA_Ligne_B = tkinter.Scale ( FRM_Bandeau , command = lambda event : FNC_Bouger ( "b" ) )
SCA_Ligne_C = tkinter.Scale ( FRM_Bandeau , command = lambda event : FNC_Bouger ( "c" ) )
LAB_Ligne_A = tkinter.Label ( FRM_Bandeau , text = " 000 00 " )
LAB_Ligne_B = tkinter.Label ( FRM_Bandeau , text = " 000 00 " )
LAB_Ligne_C = tkinter.Label ( FRM_Bandeau , text = " 000 00 " )
FRM_Bandeau.add ( SCA_Ligne_A , padx = 2 , pady = 4 )
FRM_Bandeau.add ( LAB_Ligne_A , padx = 2 , pady = 4 )
FRM_Bandeau.add ( SCA_Ligne_B , padx = 2 , pady = 4 )
FRM_Bandeau.add ( LAB_Ligne_B , padx = 2 , pady = 4 )
FRM_Bandeau.add ( SCA_Ligne_C , padx = 2 , pady = 4 )
FRM_Bandeau.add ( LAB_Ligne_C , padx = 2 , pady = 4 )
FRM_Bandeau.add ( BUT_Quitter , padx = 2 , pady = 4 )
FRM_Bandeau.pack ( padx = 5 , pady = 2 )
SCA_Ligne_A [ "from_" ] = FRM_Bandeau.sash_coord ( 0 ) [ 0 ] - 40
SCA_Ligne_A [ "to" ] = FRM_Bandeau.sash_coord ( 0 ) [ 0 ] + 40
SCA_Ligne_A.set ( FRM_Bandeau.sash_coord ( 0 ) [ 0 ] )
SCA_Ligne_B [ "from_" ] = FRM_Bandeau.sash_coord ( 2 ) [ 0 ] - 40
SCA_Ligne_B [ "to" ] = FRM_Bandeau.sash_coord ( 2 ) [ 0 ] + 40
SCA_Ligne_B.set ( FRM_Bandeau.sash_coord ( 2 ) [ 0 ] )
SCA_Ligne_C [ "from_" ] = FRM_Bandeau.sash_coord ( 4 ) [ 0 ] - 40
SCA_Ligne_C [ "to" ] = FRM_Bandeau.sash_coord ( 4 ) [ 0 ] + 40
SCA_Ligne_C.set ( FRM_Bandeau.sash_coord ( 4 ) [ 0 ] )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de