mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
228729305b | |||
d9ff3d998c | |||
6a43dfd9bf |
@ -1,4 +1,4 @@
|
||||
__version__ = "4.5.5"
|
||||
__version__ = "4.5.6"
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user