3 Commits

Author SHA1 Message Date
228729305b Bump to 4.5.6 2022-07-17 20:35:12 +02:00
d9ff3d998c fixed command function bug in CTkSwitch 2022-07-17 20:34:54 +02:00
6a43dfd9bf added corner_radius to .configure() of CTkButton 2022-07-14 13:57:02 +02:00
5 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,4 @@
__version__ = "4.5.5"
__version__ = "4.5.6"
import os
import sys

View File

@ -252,6 +252,10 @@ class CTkButton(CTkBaseClass):
self.image = kwargs.pop("image")
require_redraw = True
if "corner_radius" in kwargs:
self.corner_radius = kwargs.pop("corner_radius")
require_redraw = True
if "compound" in kwargs:
self.compound = kwargs.pop("compound")
require_redraw = True

View File

@ -104,13 +104,13 @@ class CTkSwitch(CTkBaseClass):
self.text_label.bind("<Leave>", self.on_leave)
self.text_label.bind("<Button-1>", self.toggle)
self.draw() # initial draw
self.set_cursor()
if self.variable is not None and self.variable != "":
self.variable_callback_name = self.variable.trace_add("write", self.variable_callback)
self.check_state = True if self.variable.get() == self.onvalue else False
self.draw() # initial draw
self.set_cursor()
def set_scaling(self, *args, **kwargs):
super().set_scaling(*args, **kwargs)
@ -209,14 +209,14 @@ class CTkSwitch(CTkBaseClass):
self.draw(no_color_updates=True)
if self.command is not None:
self.command()
if self.variable is not None:
self.variable_callback_blocked = True
self.variable.set(self.onvalue if self.check_state is True else self.offvalue)
self.variable_callback_blocked = False
if self.command is not None:
self.command()
def select(self, from_variable_callback=False):
if self.state is not tkinter.DISABLED or from_variable_callback:
self.check_state = True

View File

@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
github_url = "https://github.com/TomSchimansky/CustomTkinter"
[tool.tbump.version]
current = "4.5.5"
current = "4.5.6"
# Example of a semver regexp.
# Make sure this matches current_version before

View File

@ -1,6 +1,6 @@
[metadata]
name = customtkinter
version = 4.5.5
version = 4.5.6
description = Create modern looking GUIs with Python
long_description = CustomTkinter UI-Library\n\n[](https://github.com/TomSchimansky/CustomTkinter/blob/master/documentation_images/Windows_dark.png)\n\nMore Information: https://github.com/TomSchimansky/CustomTkinter
long_description_content_type = text/markdown