Problem retrieving coordinate of a rectangle using CTkCanvas #2410
-
Hi everyone, first time using customtkinter (also first time using gitHub). When I first saw it, I definitely likes it over the tkinter (even though, I still have to use it for some specific projects). Here's my problem: creating a rectangle on CTkCanvas is no problem, I get its ID, but when comes to retrieving the coords of the same rectangle, I get an error. Here's the code: root = CTk() frame = CTkFrame(root) canvas = CTkCanvas(frame,width=50,height=50) x0, y0, x1, y1 = canvas.coords(rect_id) root.mainloop() and here's the error I get: cannot unpack non-iterable NoneType object. I'm pretty sure it comes from the line where I try to retrieve the coords of the rectangle. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @rzfNotahina
So you should use Hope this helps |
Beta Was this translation helpful? Give feedback.
Hi @rzfNotahina
CTkCanvas
is not meant to be used as a widget. It's used for internal widget rendering.TomSchimansky mentions this in the issue #2066
So you should use
Canvas
directly from tkinter and It should work as intented.Hope this helps