mirror of
				https://github.com/TomSchimansky/CustomTkinter.git
				synced 2023-08-10 21:13:13 +03:00 
			
		
		
		
	updated version
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
				
			|||||||
__version__ = "1.1"
 | 
					__version__ = "1.2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .customtkinter_button import CTkButton
 | 
					from .customtkinter_button import CTkButton
 | 
				
			||||||
from .customtkinter_slider import CTkSlider
 | 
					from .customtkinter_slider import CTkSlider
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,7 @@ class SystemAppearanceModeListener(Thread):
 | 
				
			|||||||
            sleep(0.5)
 | 
					            sleep(0.5)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SystemAppearanceModeListenerNoThread():
 | 
					class SystemAppearanceModeListenerNoThread:
 | 
				
			||||||
    def __init__(self, callback):
 | 
					    def __init__(self, callback):
 | 
				
			||||||
        self.appearance_mode = self.detect_appearance_mode()
 | 
					        self.appearance_mode = self.detect_appearance_mode()
 | 
				
			||||||
        self.callback_function = callback
 | 
					        self.callback_function = callback
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -298,7 +298,7 @@ class CTkButton(tkinter.Frame):
 | 
				
			|||||||
    def set_text(self, text):
 | 
					    def set_text(self, text):
 | 
				
			||||||
        self.text = text
 | 
					        self.text = text
 | 
				
			||||||
        if self.text_label is not None:
 | 
					        if self.text_label is not None:
 | 
				
			||||||
            self.text_label.configure(text=self.text, width=len(self.text))
 | 
					            self.text_label.configure(text=self.text)  #, width=len(self.text))
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            sys.stderr.write("ERROR (CTkButton): Cant change text because button has no text.")
 | 
					            sys.stderr.write("ERROR (CTkButton): Cant change text because button has no text.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,6 +38,7 @@ class CTkSlider(tkinter.Frame):
 | 
				
			|||||||
        self.fg_color = fg_color
 | 
					        self.fg_color = fg_color
 | 
				
			||||||
        self.button_color = self.bg_color if button_color is None else button_color
 | 
					        self.button_color = self.bg_color if button_color is None else button_color
 | 
				
			||||||
        self.button_hover_color = self.bg_color if button_hover_color is None else button_hover_color
 | 
					        self.button_hover_color = self.bg_color if button_hover_color is None else button_hover_color
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.appearance_mode = AppearanceModeTracker.get_mode()  # 0: "Light" 1: "Dark"
 | 
					        self.appearance_mode = AppearanceModeTracker.get_mode()  # 0: "Light" 1: "Dark"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.width = width
 | 
					        self.width = width
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user