⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ Notebook
tkinter.ttk.Notebook ( ).tabs ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ Notebook
tkinter.ttk.Notebook ( ).tabs ( )
DESCRIPTION.
Retourne un tuple ( ) contenant les identifiants des onglets d'un classeur.
SYNTAXE.
NTB_Classeur.tabs ( )
NTB_Classeur = instance quelconque de tkinter.ttk.Notebook ( ) [ OBLIGATOIRE ]
.tabs ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
REMARQUES.
Les identifiants des onglets indique le chemin du contenu d'onglet. Ils sont retournés dans l'ordre de leur position dans le classeur.
voir la méthode tkinter.winfo_pathname ( ) pour plus de détails sur les chemins des controles dans tkinter.
EXEMPLE.
import tkinter , tkinter.ttk
TKI_Principal = tkinter.Tk ( )
tkinter.ttk.Style ( ).configure ( "TNotebook" , tabposition = "w" )
NTB_Classeur = tkinter.ttk.Notebook ( TKI_Principal )
for kcycle in range ( 3 ) :
NTB_Classeur.add ( tkinter.Label ( text = f"Etiquette : 0{ kcycle } ..." ) , text = f"Label { kcycle }" )
NTB_Classeur.add ( tkinter.Button ( text = f"Bouton : 0{ kcycle } ..." ) , text = f"Button { kcycle }" )
NTB_Classeur.add ( tkinter.Entry ( text = f"Saisie : 0{ kcycle } ..." ) , text = f"Entry { kcycle }" )
tkinter.Button ( text = "Quitter" , command = TKI_Principal.destroy ).pack ( side = "bottom" , fill = "both" )
NTB_Classeur.pack ( side = "left" )
tkinter.Label ( text = "\n Liste des onglets \n de NTB_Classeur. \n" ).pack ( )
tkinter.Label ( text = "\n".join ( NTB_Classeur.tabs ( ) ) ).pack ( )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de