⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ liste des attributs
tkinter.ttk.displaycolumns
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ liste des attributs
tkinter.ttk.displaycolumns
DESCRIPTION.
Définit, ou retourne, la liste des colonnes à afficher et leur ordre.
SYNTAXE.
displaycolumns = sequence
REMARQUES.
sequence est un objet collection tel que list ( ) ou tuple ( ). Les éléments de sequence :
- doivent être identifiants de colonne définie avec l'attribut columns du controle appelant ;
- peut être ( "#all" ) pour afficher toutes les colonnes ;
- ne doit jamais contenir la colonne racine "#0".
EXEMPLE.
import tkinter , tkinter.ttk
def FNC_Affichage ( ) :
if BUT_Choix [ "text" ] == "Top 3" :
BUT_Choix [ "text" ] = "Tous"
TRV_Langage [ "displaycolumns" ] = ( "#5" , "#3" , "#4" )
else :
BUT_Choix [ "text" ] = "Top 3"
TRV_Langage [ "displaycolumns" ] = ( "#all" )
TKI_Principal = tkinter.Tk ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
BUT_Choix = tkinter.Button ( TKI_Principal , text = "Top 3" , command = FNC_Affichage )
TRV_Langage = tkinter.ttk.Treeview ( TKI_Principal , columns = ( "#1" , "#2" , "#3" , "#4" , "#5" , "#6" ) )
TRV_Langage.heading ( "#0" , text = "Action" )
TRV_Langage.heading ( "#1" , text = "C" )
TRV_Langage.heading ( "#2" , text = "C#" )
TRV_Langage.heading ( "#3" , text = "Java" )
TRV_Langage.heading ( "#4" , text = "JavaScript" )
TRV_Langage.heading ( "#5" , text = "Python" )
TRV_Langage.heading ( "#6" , text = "Ruby" )
TRV_Langage.pack ( )
BUT_Choix.pack ( )
BUT_Quitter.pack ( )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de