Closed emircetinmemis closed 1 year ago
I forgat too add this.
ctk.deactivate_automatic_dpi_awareness()
And again as I said before, It doesn't just look like what ,it actually should look like.You can still use a tkinter treevieew in CustomTkinter:
from tkinter import ttk
import customtkinter
class WithCustomTk(customtkinter.CTk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.grid_columnconfigure(0, weight=1)
self.font = customtkinter.CTkFont("Arial", 18)
self.treeview_heading_style = ttk.Style(self)
self.treeview_heading_style.theme_use("clam")
self.treeview_heading_style.configure("Treeview.Heading", background="black", foreground="white",
highlightthickness=0, bd=0, font=self.font)
self.treeview_style = ttk.Style(self)
self.treeview_style.theme_use("clam")
self.treeview_style.configure("Treeview", background="black", foreground="white",
highlightthickness=0, bd=0, font=self.font)
self.treeview = ttk.Treeview(self, height=4, show="headings", selectmode="browse")
self.treeview.grid(row=0, column=0, sticky="nsew")
self.treeview["columns"] = ("one", "two", "three")
self.treeview.heading("one", text="Column A")
self.treeview.heading("two", text="Column B")
self.treeview.heading("three", text="Column C")
self.treeview.column("one", width=100)
self.treeview.column("two", width=100)
self.treeview.column("three", width=100)
self.treeview.insert("", "end", values=("1", "2", "3"))
self.treeview.insert("", "end", values=("4", "5", "6"))
self.treeview.insert("", "end", values=("7", "8", "9"))
if __name__ == "__main__":
app = WithCustomTk()
app.mainloop()
Hi, I have been searching about UI frameworks for tkinter, and found out the most accurate one was customtkinter for me. I was about to turn my application to customtkinter, but I realized that I'm facing with a problem on a specific widget. My application uses several tables or lists on displaying purposes. So with this, I must be able to use a widget like Treeview which comes from the culture of tkinker.
An example of a basic execution;
And this shortly results as;
What I have tried to do;
The solution;