mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
added different default color themes
This commit is contained in:
@ -4,6 +4,7 @@ import customtkinter
|
||||
import sys
|
||||
|
||||
customtkinter.set_appearance_mode("System") # Other: "Light", "Dark"
|
||||
customtkinter.set_default_color_theme("dark-blue") # Themes: "blue" (standard), "green", "dark-blue"
|
||||
|
||||
|
||||
class App(customtkinter.CTk):
|
||||
@ -114,13 +115,13 @@ class App(customtkinter.CTk):
|
||||
width=160,
|
||||
height=16,
|
||||
border_width=5,
|
||||
progress_color=("gray65", "gray40"),
|
||||
command=self.progressbar.set)
|
||||
self.slider_2.place(x=20, rely=0.7, anchor=tkinter.W)
|
||||
self.slider_2.set(0.7)
|
||||
|
||||
self.label_info_2 = customtkinter.CTkLabel(master=self.frame_right,
|
||||
text="CTkLabel: Lorem ipsum",
|
||||
fg_color=None,
|
||||
width=180,
|
||||
height=20,
|
||||
justify=tkinter.CENTER)
|
||||
|
@ -131,6 +131,7 @@ class App(customtkinter.CTk):
|
||||
|
||||
self.label_info_2 = customtkinter.CTkLabel(master=self.frame_right,
|
||||
text="CTkLabel: Lorem ipsum",
|
||||
fg_color=None,
|
||||
width=180,
|
||||
height=20,
|
||||
justify=tkinter.CENTER)
|
||||
|
@ -5,6 +5,7 @@ from PIL import Image, ImageTk
|
||||
import os
|
||||
|
||||
customtkinter.set_appearance_mode("Dark") # Other: "Light", "System"
|
||||
customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
|
||||
|
||||
PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
@ -2,12 +2,13 @@ import time
|
||||
import tkinter
|
||||
import customtkinter # <- import the CustomTkinter module
|
||||
|
||||
customtkinter.set_appearance_mode("System") # Other: "Dark", "Light"
|
||||
customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
|
||||
|
||||
root_tk = customtkinter.CTk() # create CTk window like you do with the Tk window (you can also use normal tkinter.Tk window)
|
||||
root_tk.geometry("400x300")
|
||||
root_tk.title("CustomTkinter Test")
|
||||
|
||||
customtkinter.set_appearance_mode("System") # Other: "Dark", "Light"
|
||||
|
||||
|
||||
def button_function():
|
||||
print("Button click")
|
||||
@ -34,9 +35,9 @@ button_1 = customtkinter.CTkButton(master=frame_1, corner_radius=10, command=but
|
||||
button_1.place(relx=0.5, rely=0.4, anchor=tkinter.CENTER)
|
||||
# button_1.configure(state="disabled")
|
||||
|
||||
slider_1 = customtkinter.CTkSlider(master=frame_1, command=slider_function, from_=0, to=1, progress_color="gray20")
|
||||
slider_1 = customtkinter.CTkSlider(master=frame_1, command=slider_function, from_=0, to=1)
|
||||
slider_1.place(relx=0.5, rely=0.55, anchor=tkinter.CENTER)
|
||||
slider_1.set(1.5)
|
||||
slider_1.set(0.5)
|
||||
|
||||
entry_1 = customtkinter.CTkEntry(master=frame_1)
|
||||
entry_1.place(relx=0.5, rely=0.75, anchor=tkinter.CENTER)
|
||||
|
@ -6,6 +6,7 @@ import os
|
||||
PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
customtkinter.set_appearance_mode("System") # Other: "Dark", "Light"
|
||||
customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
|
||||
|
||||
root_tk = customtkinter.CTk() # create CTk window like you do with the Tk window (you can also use normal tkinter.Tk window)
|
||||
root_tk.geometry("400x400")
|
||||
|
Reference in New Issue
Block a user