added command to .configure() of CTkButton and CTkCheckBox

This commit is contained in:
Tom Schimansky 2022-01-08 13:13:10 +01:00
parent 243bedb8c9
commit 587a597e6b
3 changed files with 9 additions and 1 deletions

View File

@ -486,6 +486,10 @@ class CTkButton(tkinter.Frame):
require_redraw = True require_redraw = True
del kwargs["text_color"] del kwargs["text_color"]
if "command" in kwargs:
self.function = kwargs["command"]
del kwargs["command"]
super().configure(*args, **kwargs) super().configure(*args, **kwargs)
if require_redraw: if require_redraw:

View File

@ -296,6 +296,10 @@ class CTkCheckBox(tkinter.Frame):
require_redraw = True require_redraw = True
del kwargs["border_color"] del kwargs["border_color"]
if "command" in kwargs:
self.function = kwargs["command"]
del kwargs["command"]
super().configure(*args, **kwargs) super().configure(*args, **kwargs)
if require_redraw: if require_redraw:

View File

@ -4,7 +4,7 @@ import customtkinter
import sys import sys
customtkinter.set_appearance_mode("System") # Other: "Light", "Dark" customtkinter.set_appearance_mode("System") # Other: "Light", "Dark"
customtkinter.set_default_color_theme("dark-blue") # Themes: "blue" (standard), "green", "dark-blue" customtkinter.set_default_color_theme("green") # Themes: "blue" (standard), "green", "dark-blue"
class App(customtkinter.CTk): class App(customtkinter.CTk):