mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
added command to .configure() of CTkButton and CTkCheckBox
This commit is contained in:
parent
243bedb8c9
commit
587a597e6b
@ -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:
|
||||||
|
@ -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:
|
||||||
|
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user