The ttkbootstrap style is not working.
The window looks like this.
The full code is here.
This is my code:
a.py
:
from tkinter import filedialog
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
from b import *
root = ttk.Window()
b1 = ttk.Button(root, text="Button 1", bootstyle=SUCCESS, command=test)
b1.pack(side=LEFT, padx=5, pady=10)
b2 = ttk.Button(root, text="Button 2", bootstyle=(INFO, OUTLINE))
b2.pack(side=LEFT, padx=5, pady=10)
root.mainloop()
b.py
:
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
def test():
root = ttk.Window()
b1 = ttk.Button(root, text="Button 1", bootstyle=SUCCESS)
b1.pack(side=LEFT, padx=5, pady=10)
root.mainloop()
When I call test()
function in a.py
, the window created by b.py
looks strange.
It’s still the tkinter style.
How can I fix it? I don’t like the tkinter style.
New contributor
Gordon Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.