You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a tkinter treeview that is updated every second on my program , it takes value from a csv that is being updated each second
I want to know if its possible to use this CTkTable instead of the ugly tree view , thanks in advanced <3 ?
#Tree view
tree = ttk.Treeview(treeframe)
tree["columns"] = tuple() # Empty tuple for now, we'll configure columns later
tree["show"] = "headings" # Hide the default empty column
tree.place(x = 1 , y = 1, width=598, height=448)
def update_treeview():
# print("tree refresh data")
global data, parameters, column_name_to_drop
if parameters:
# Configure columns in the Treeview based on the dataframe columns
tree["columns"] = tuple(parameters)
column_width = int(598 / len(parameters))
# Create headings for each column
for col in parameters:
# Adjust column width based on the content
tree.column(col, width=column_width, stretch=False)
tree.heading(col, text=col)
tree.delete(*tree.get_children())
# Insert the last 20 rows into the Treeview
for index, row in data.tail(20).iterrows():
tree.insert("", "end", values=list(row))
tab1.after(1000, update_treeview)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a tkinter treeview that is updated every second on my program , it takes value from a csv that is being updated each second
I want to know if its possible to use this CTkTable instead of the ugly tree view , thanks in advanced <3 ?
#Tree view
tree = ttk.Treeview(treeframe)
tree["columns"] = tuple() # Empty tuple for now, we'll configure columns later
tree["show"] = "headings" # Hide the default empty column
tree.place(x = 1 , y = 1, width=598, height=448)
def update_treeview():
# print("tree refresh data")
global data, parameters, column_name_to_drop
if parameters:
# Configure columns in the Treeview based on the dataframe columns
tree["columns"] = tuple(parameters)
column_width = int(598 / len(parameters))
# Create headings for each column
for col in parameters:
# Adjust column width based on the content
tree.column(col, width=column_width, stretch=False)
tree.heading(col, text=col)
tree.delete(*tree.get_children())
Beta Was this translation helpful? Give feedback.
All reactions