⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ Style
tkinter.ttk.Style ( ).theme_use ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ extension ttk ⇨ Style
tkinter.ttk.Style ( ).theme_use ( )
DESCRIPTION.
Modifie ou retourne le thème actif.
SYNTAXE.
tkinter.ttk.Style ( ).theme_use ( nom )
tkinter.ttk.Style ( ).theme_use ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
nom ⇨ identifiant du thème [ OBLIGATOIRE ]
REMARQUES.
nom est un str ( ) quelconque mais valide et existant. Si nom est absent , la méthode tkinter.ttk.Style ( ).theme_use ( ) retourne le nom du thème actuellement actif.
EXEMPLE.
import tkinter , tkinter.ttk
FNC_Theme = lambda event : tkinter.ttk.Style ( ).theme_use ( BOX_Choix.get ( ) )
TKI_Principal = tkinter.Tk ( )
BOX_Choix = tkinter.ttk.Combobox ( TKI_Principal , values = tkinter.ttk.Style ( ).theme_names ( ) )
BOX_Choix.bind ( "<<ComboboxSelected>>" , FNC_Theme )
BOX_Choix.set ( tkinter.ttk.Style ( ).theme_use ( ) )
tkinter.ttk.Label ( TKI_Principal , text = "\n Test de changement \n" , relief = "solid" ).pack ( padx = 5 , pady = 5 )
tkinter.ttk.Checkbutton ( TKI_Principal , text = "Coche" ).pack ( )
tkinter.ttk.Radiobutton ( TKI_Principal , text = "Radio" ).pack ( )
tkinter.ttk.Scale ( TKI_Principal , orient = "horizontal" ).pack ( padx = 5 , pady = 5 )
tkinter.ttk.Scrollbar ( TKI_Principal , orient = "horizontal" ).pack ( fill = "both" , padx = 5 , pady = 5 )
BOX_Choix.pack ( padx = 5 , pady = 5 )
tkinter.Button ( TKI_Principal , text = "Quitter" , command = TKI_Principal.destroy ).pack ( )
FNC_Theme ( None )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de