CTkTable icon indicating copy to clipboard operation
CTkTable copied to clipboard

About performance optimization/better build scenarios

Open childeyouyu opened this issue 1 year ago • 3 comments

A month ago, I reported that constantly generating multiple tables would cause the interface to flicker, and there was no good solution at that time, and finally decided to generate a new single-row table after reading the data every time and put it at the bottom, the code is as follows:

    def update_values(self, values, used_devices):
        # 将读取来的数据填充到相应的表格里
        # 在相应的 tab 下生成表格
        for used_device in used_devices:
            # value 的判断
            value = []
            for i in values[int(used_device[1][-1]) - 1]:
                value.append(i)
            # value = values[used_devices.index(used_device)]
            table = CTkTable(master=self.table_list.get(used_device[0]), corner_radius=0, values=[value])
            table.pack(fill="both", expand=True)

However, my solution is not good, it will cause a lot of waste in performance, even on my 16G computer, let alone send it to customers. Is there any good change or other solution to my code/requirements?

childeyouyu avatar Jan 30 '24 01:01 childeyouyu