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

Corner cell de-selection leaves artifacts #97

Open
resnbl opened this issue May 18, 2024 · 0 comments
Open

Corner cell de-selection leaves artifacts #97

resnbl opened this issue May 18, 2024 · 0 comments

Comments

@resnbl
Copy link

resnbl commented May 18, 2024

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

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