Skip to content

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

@btcmatos

Description

@btcmatos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions