CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

CTkCheckBox.configure(corner_radius/border_width=) triggers exception

Open avalon60 opened this issue 2 years ago • 1 comments

CustomTkinter 4.6.3

Adding this third line, to simple_example.py, causes the exception:

checkbox_1 = customtkinter.CTkCheckBox(master=frame_1)
checkbox_1.pack(pady=12, padx=10)
checkbox_1.configure(corner_radius=0)

Exception raised:

  File "/home/clive/PycharmProjects/customtk/simple_example.py", line 56, in <module>
    checkbox_1.configure(corner_radius=0)
  File "/home/clive/PycharmProjects/customtk/venv/lib/python3.8/site-packages/customtkinter/widgets/ctk_checkbox.py", line 218, in configure
    super().configure(require_redraw=require_redraw, **kwargs)
  File "/home/clive/PycharmProjects/customtk/venv/lib/python3.8/site-packages/customtkinter/widgets/widget_base_class.py", line 131, in configure
    super().configure(**kwargs)
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1646, in configure
    return self._configure('configure', cnf, kw)
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1636, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-corner_radius"

A similar exception is raised when trying to reconfigure border width:


  File "/home/clive/PycharmProjects/customtk/venv/lib/python3.8/site-packages/customtkinter/widgets/ctk_checkbox.py", line 218, in configure
    super().configure(require_redraw=require_redraw, **kwargs)
  File "/home/clive/PycharmProjects/customtk/venv/lib/python3.8/site-packages/customtkinter/widgets/widget_base_class.py", line 131, in configure
    super().configure(**kwargs)
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1646, in configure
    return self._configure('configure', cnf, kw)
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1636, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-border_width"

avalon60 avatar Nov 03 '22 08:11 avalon60

@avalon60 Corner_radius and border_width are not implemented in the configure settings of checkbox.

These are the configurable values of checkbox: https://github.com/TomSchimansky/CustomTkinter/blob/master/customtkinter/widgets/ctk_checkbox.py#L175

Ig, it will be available in the next update.

For now use checkbox_1.corner_radius=0 and checkbox_1.border_width=0 to change them.

Akascape avatar Nov 03 '22 10:11 Akascape

Fixed with version 5.0.0.

TomSchimansky avatar Dec 02 '22 12:12 TomSchimansky