CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

CTkSwitch.configure(corner_radius=...) triggers exception

Open avalon60 opened this issue 3 years ago • 1 comments

CustomTkinter 4.6.3

This was reproduced with simple_example.py:

switch_1 = customtkinter.CTkSwitch(master=frame_1)
switch_1.pack(pady=12, padx=10)
switch_1.configure(corner_radius=5)

Here is the error stack:

Traceback (most recent call last):
  File "/home/clive/PycharmProjects/customtk/simple_example.py", line 73, in <module>
    switch_1.configure(corner_radius=5)
  File "/home/clive/PycharmProjects/customtk/venv/lib/python3.8/site-packages/customtkinter/widgets/ctk_switch.py", line 326, 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"

avalon60 avatar Nov 04 '22 16:11 avalon60

@avalon60 Corner_radius is not added in the configure settings of switch:

For these we have to use switch_1.corner_radius=0 in order to change it.

Akascape avatar Nov 05 '22 09:11 Akascape

Fixed with version 5.0.0.

TomSchimansky avatar Dec 02 '22 12:12 TomSchimansky