⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ liste des attributs
tkinter.ttk.indicatorsize
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ liste des attributs
tkinter.ttk.indicatorsize
DESCRIPTION.
Définit ou retourne la taille de la flèche de développement des nœuds d'une arborescence.
SYNTAXE.
indicatorsize = taille
REMARQUES.
Si taille est un int ( ) les mesures sont exprimées en pixels (ex. 6 pour 6 pixels). Pour utiliser une autre unité de mesure, taille doit être un str ( ) contenant un nombre suivi d'un caractère précisant cette unité désirée:
- c, en centimètres (ex. "3c" pour 3 centimètres) ;
- m, en millimètres (ex. "7m" pour 7 multimètres) ;
- i, en pousses (inche) (ex. "4i" pour 4 pousses) ;
- p, en points d'impression (ex. "12p" pour 12 points).
Le comportement de cet attribut, peut varier selon la combinaison controle / environnement utilisée. Il peut même, dans certain cas, être ignoré.
EXEMPLE.
import tkinter , tkinter.ttk
def FNC_Fleche ( event ) :
tkinter.ttk.Style ( ).configure ( "Item" , indicatorsize = SCA_Taille.get ( ) )
tkinter.ttk.Style ( ).configure ( "Item" , indicatormargins = SCA_Marge.get ( ) )
TKI_Principal = tkinter.Tk ( )
BUT_Quitter = tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy )
SCA_Taille = tkinter.Scale ( TKI_Principal , orient = "horizontal" , to = 42 , command = FNC_Fleche )
SCA_Marge = tkinter.Scale ( TKI_Principal , orient = "horizontal" , to = 42 , command = FNC_Fleche )
TRV_Test = tkinter.ttk.Treeview ( TKI_Principal )
TRV_Test.heading ( "#0" , text = "Noeuds" )
TRV_Test.insert ( "" , "end" , "Noeud_A" , text = "Noeud A ..." )
TRV_Test.insert ( "" , "end" , "Noeud_B" , text = "Noeud B ..." )
TRV_Test.insert ( "" , "end" , "Noeud_C" , text = "Noeud C ..." )
for kfeuille in range ( 5 ) :
TRV_Test.insert ( "Noeud_A" , "end" , f"Noeud_A-{ kfeuille }" , text = f"Sous Noued A { kfeuille }" )
TRV_Test.insert ( f"Noeud_A-0" , "end" , kfeuille , text = f"Feuille A0 { kfeuille }" )
TRV_Test.insert ( "Noeud_B" , "end" , f"Noeud_B-{ kfeuille }" , text = f"Feuille B { kfeuille }" )
TRV_Test.insert ( "Noeud_C" , "end" , f"Noeud_C-{ kfeuille }" , text = f"Feuille C { kfeuille }" )
tkinter.Label ( TKI_Principal , text = "Taille" ).grid ( row = 0 , column = 0 , sticky = "se" )
SCA_Taille.grid ( row = 0 , column = 1 )
tkinter.Label ( TKI_Principal , text = "Marge" ).grid ( row = 1 , column = 0 , sticky = "se" )
SCA_Marge.grid ( row = 1 , column = 1 )
TRV_Test.grid ( row = 2 , column = 0 , columnspan = 2 )
BUT_Quitter.grid ( row = 3 , column = 0 , columnspan = 2 )
SCA_Taille.set ( 12 )
SCA_Marge.set ( 1 )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de