I want to create/modify new elements and define a new layout in tkinter ttk syle but I not sure how to configure that style in a widget.
import tkinter as tk
from tkinter import ttk
def _initialize_style():
style = ttk.Style()
image = tk.PhotoImage(data=image_data, format="gif -index 0")
style.element_create("Button.button2",
"image", image,
sticky="e")
return style
style = _initialize_style()
root = tk.Tk()
button = ttk.Button(root, text='style', style='TButton')
button.pack()
root.mainloop()
can anyone help me with that.