⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ PanedWindow
tkinter.PanedWindow ( ).forget ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ PanedWindow
tkinter.PanedWindow ( ).forget ( )
DESCRIPTION.
Retire un controle du bandeau de controles.
SYNTAXE.
FRM_Bandeau.forget ( enfant )
FRM_Bandeau ⇨ instance de tkinter.PanedWindow ( ) [ OBLIGATOIRE ]
.forget ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
enfant ⇨ controle à retirer [ OBLIGATOIRE ]
REMARQUES.
enfant doit être l'identifiant, le chemin ou une variable désignant un controle valide et existant.
La méthode tkinter.PanedWindow ( ).forget ( ) retire controle du bandeau, ses option de configuration sont perdu et la cellule qui le contenait est détruite, mais le controle, lui n'est pas supprimé. Il pourra être replacé dans le bandeau avec la méthode tkinter.PanedWindow ( ).add ( ).
EXEMPLE.
import tkinter
def FNC_Remettre ( ) :
kcontroles = FRM_Bandeau.panes ( )
for kcontrole in kcontroles : FRM_Bandeau.forget ( kcontrole )
FRM_Bandeau.add ( BUT_Remettre )
FRM_Bandeau.add ( BUT_A )
FRM_Bandeau.add ( BUT_B )
FRM_Bandeau.add ( BUT_C )
FRM_Bandeau.add ( BUT_D )
FRM_Bandeau.add ( BUT_E )
FRM_Bandeau.add ( BUT_Remettre )
FRM_Bandeau.add ( BUT_Quitter )
TKI_Principal = tkinter.Tk ( )
FRM_Bandeau = tkinter.PanedWindow ( TKI_Principal , sashrelief = "groove" , relief = "groove" )
BUT_Quitter = tkinter.Button ( FRM_Bandeau , text = "Quitter" , command = TKI_Principal.destroy )
BUT_A = tkinter.Button ( FRM_Bandeau , text = "Retirer A" , command = lambda : FRM_Bandeau.forget ( BUT_A ) )
BUT_B = tkinter.Button ( FRM_Bandeau , text = "Retirer B" , command = lambda : FRM_Bandeau.forget ( BUT_B ) )
BUT_C = tkinter.Button ( FRM_Bandeau , text = "Retirer C" , command = lambda : FRM_Bandeau.forget ( BUT_C ) )
BUT_D = tkinter.Button ( FRM_Bandeau , text = "Retirer D" , command = lambda : FRM_Bandeau.forget ( BUT_D ) )
BUT_E = tkinter.Button ( FRM_Bandeau , text = "Retirer E" , command = lambda : FRM_Bandeau.forget ( BUT_E ) )
BUT_Remettre = tkinter.Button ( FRM_Bandeau , text = "Tous remettre" , command = FNC_Remettre )
FRM_Bandeau.pack ( padx = 5 , pady = 2 )
FNC_Remettre ( )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de