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

canvas.coords is not returning any values #2353

Open
boreland opened this issue Apr 3, 2024 · 1 comment
Open

canvas.coords is not returning any values #2353

boreland opened this issue Apr 3, 2024 · 1 comment

Comments

@boreland
Copy link

boreland commented Apr 3, 2024

Describe the bug

Expected behavior

To Reproduce

tkinter example that works correctly

@furas
Copy link

furas commented May 2, 2024

EDIT:

There are other bug reports for this problem:

https://github.com/TomSchimansky/CustomTkinter/issues?q=is%3Aissue+is%3Aopen+coords


I found that canvas.coords needs return in some lines with super() in file

customtkinter/windows/widgets/core_rendering/ctk_canvas.py 

similar to

    def coords(self, tag_or_id, *args):

        if type(tag_or_id) == str and "ctk_aa_circle_font_element" in self.gettags(tag_or_id):
            coords_id = self.find_withtag(tag_or_id)[0]  # take the lowest id for the given tag
            return super().coords(coords_id, *args[:2])

            if len(args) == 3:
                return super().itemconfigure(coords_id, font=("CustomTkinter_shapes_font", -int(args[2]) * 2), text=self._get_char_from_radius(args[2]))

        elif type(tag_or_id) == int and tag_or_id in self._aa_circle_canvas_ids:
            return super().coords(tag_or_id, *args[:2])

            if len(args) == 3:
                return super().itemconfigure(tag_or_id, font=("CustomTkinter_shapes_font", -args[2] * 2), text=self._get_char_from_radius(args[2]))

        else:
            return super().coords(tag_or_id, *args)

but I'm not sure if all super() need return.

I didn't check it but I think canvas.itemconfig may also need return in some lines with super() to return value.

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

2 participants