CTkTable icon indicating copy to clipboard operation
CTkTable copied to clipboard

Corner cell de-selection leaves artifacts

Open resnbl opened this issue 1 year ago • 0 comments

When using the default rounded corners, selecting then de-selecting a corner cell leaves artifacts around the cell/button. CtkTable corners

Here is my code to reproduce the above (after clicking on a corner and clicking again to de-select):

import customtkinter as ctk
from CTkTable import *

selection: tuple[int, int] | None = None


def cell_pressed(data):
    global selection

    new_selection = data['row'], data['column']

    if selection:
        table.deselect(*selection)
        if selection == new_selection:
            selection = None
            return

    selection = new_selection
    table.select(*selection)
    print('pressed', selection, data['value'])


root = ctk.CTk()

value = [[1,2,3,4,5],
         [1,2,3,4,5],
         [1,2,3,4,5],
         [1,2,3,4,5],
         [1,2,3,4,5]]

table = CTkTable(master=root, row=5, column=5, values=value,
                 # corner_radius=0,
                 command=cell_pressed)
table.pack(expand=True, fill="both", padx=20, pady=20)

root.mainloop()

For the time being, I am setting corner_radius=0 as a work-around as it is a purely cosmetic issue (but I do prefer the rounded corners...)

deets: macOS-13.6.6-x86_64-i386-64bit Python 3.12.2 Tk/Tcl 8.6.14 customtkinter 5.2.2 CtkTable 1.1

resnbl avatar May 18 '24 00:05 resnbl