Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTK crashes after the 3rd CTkTable.update_data consecutive #99

Open
btcmatos opened this issue May 21, 2024 · 0 comments
Open

CTK crashes after the 3rd CTkTable.update_data consecutive #99

btcmatos opened this issue May 21, 2024 · 0 comments

Comments

@btcmatos
Copy link

btcmatos commented May 21, 2024

Hi,

i've been playing with this widget and i need to make constant refreshes on the table.
as of now, i'm using a pretty simple test code with 3 set of data, and after the 3rd update, no matter the order, (3rd data change) the table simply fail with the error:

"Too early to use font: no default root window"

my code is as follows:

_root = customtkinter.CTk()

table = CTkTable(master=root, row=5, column=6, values=[])
table.pack()

def v1():
value1 = citytableinfo('food')
CTkTable.configure(table, values=value1)
print(value1)
CTkTable.update_data(table)

def v2():
value2 = citytableinfo('stone1')
# CTkTable.update_values(table, values=value2)
CTkTable.configure(table, values=value2)
print(value2)
CTkTable.update_data(table)

def v3():
value3 = citytableinfo('gold1')
CTkTable.configure(table, values=value3)
print(value3)
CTkTable.update_data(table)

bt1 = customtkinter.CTkButton(root, text="v1", command=lambda: v1())
bt2 = customtkinter.CTkButton(root, text="v2", command=lambda: v2())
bt3 = customtkinter.CTkButton(root, text="v3", command=lambda: v3())
bt1.pack()
bt2.pack()
bt3.pack()_

as anyone had a similar issue?
FYI: citytableinfo('stone1') comes from a SQL query and as a set of data with 5 rows and 6 collumns with simple integer data

lmk if you need any aditional info

@btcmatos btcmatos changed the title update fails after 3rd update CTK crashes after the 3rd CTkTable.update_data consecutive May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant