Internal error while (re)rendering widgets
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the error on Windows with overlapping widgets, resizing, or overflowing text, then trace the callback from windows/widgets/core_widget_classes/ctk_base_class.py into core_rendering/draw_engine.py and core_rendering/ctk_canvas.py. Confirm how the affected canvas coordinate updates behave in these cases. Done means the reported Tkinter callback error no longer occurs during those UI changes.
Written by the indexing model from the issue text.
Description
customtkinter 5.2.2
Windows 10 Version 10.0.19045 Build 19045
I couldn't reliably reproduce the error, but it gets thrown occasionally whenever the UI dynamically changes, such as pressing a button or showing/hiding widgets.
Is is similar to #1006, but I am using no threads explicitly, but the .after() method.
Update: I've found out that the error gets thrown when wigets overlap when they shouldn't. Resizing my window or intentionally overflowing a text box can cause the error to be thrown reliably.
Traceback (most recent call last):
File "\Lib\tkinter\__init__.py", line 1962, in __call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\core_widget_classes\ctk_base_class.py", line 188, in _update_dimensions_event
self._draw(no_color_updates=True) # faster drawing without color changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\ctk_frame.py", line 110, in _draw
requires_recoloring = self._draw_engine.draw_rounded_rect_with_border(self._apply_widget_scaling(self._current_width),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\core_rendering\draw_engine.py", line 128, in draw_rounded_rect_with_border
return self.__draw_rounded_rect_with_border_font_shapes(width, height, corner_radius, border_width, inner_corner_radius, ())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\core_rendering\draw_engine.py", line 285, in __draw_rounded_rect_with_border_font_shapes
self._canvas.coords("inner_oval_1_a", border_width + inner_corner_radius, border_width + inner_corner_radius, inner_corner_radius)
File "\Lib\site-packages\customtkinter\windows\widgets\core_rendering\ctk_canvas.py", line 87, in coords
super().coords(coords_id, *args[:2])
File "\Lib\tkinter\__init__.py", line 2836, in coords
self.tk.splitlist(
TypeError: splitlist() argument must be encoded string without null bytes, not str
Exception in Tkinter callback
Traceback (most recent call last):
File "\Lib\tkinter\__init__.py", line 1962, in __call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\core_widget_classes\ctk_base_class.py", line 188, in _update_dimensions_event
self._draw(no_color_updates=True) # faster drawing without color changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\ctk_label.py", line 161, in _draw
requires_recoloring = self._draw_engine.draw_rounded_rect_with_border(self._apply_widget_scaling(self._current_width),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\core_rendering\draw_engine.py", line 128, in draw_rounded_rect_with_border
return self.__draw_rounded_rect_with_border_font_shapes(width, height, corner_radius, border_width, inner_corner_radius, ())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\customtkinter\windows\widgets\core_rendering\draw_engine.py", line 309, in __draw_rounded_rect_with_border_font_shapes
self._canvas.coords("inner_rectangle_1", (border_width + inner_corner_radius,
File "\Lib\site-packages\customtkinter\windows\widgets\core_rendering\ctk_canvas.py", line 99, in coords
super().coords(tag_or_id, *args)
File "\Lib\tkinter\__init__.py", line 2836, in coords
self.tk.splitlist(
TypeError: splitlist() argument must be encoded string without null bytes, not str
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TomSchimansky/CustomTkinter
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TomSchimansky/CustomTkinter#2866 · 9 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
TomSchimansky/CustomTkinter#2803 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
TomSchimansky/CustomTkinter#2128 · 4 reactions ·
-
Glassmorphism Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
TomSchimansky/CustomTkinter#2864 · 1 comment ·
-
Can't Change WM_INFO Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
TomSchimansky/CustomTkinter#2859 · 8 comments ·
All issues in TomSchimansky/CustomTkinter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100