mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
dark-blue, green theme in .json, new font .otf file for circles
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import customtkinter
|
||||
import tkinter
|
||||
|
||||
customtkinter.CTkSettings.preferred_drawing_method = "polygon_shapes"
|
||||
customtkinter.set_default_color_theme("blue")
|
||||
customtkinter.set_appearance_mode("dark")
|
||||
|
||||
@ -21,7 +20,7 @@ f2 = customtkinter.CTkFrame(app, fg_color="gray10", corner_radius=0)
|
||||
f2.grid(row=0, column=1, rowspan=1, columnspan=1, sticky="nsew")
|
||||
f2.grid_columnconfigure(0, weight=1)
|
||||
|
||||
f3 = customtkinter.CTkFrame(app, fg_color="gray90", corner_radius=0)
|
||||
f3 = customtkinter.CTkFrame(app, fg_color="gray85", corner_radius=0)
|
||||
f3.grid(row=0, column=2, rowspan=1, columnspan=1, sticky="nsew")
|
||||
f3.grid_columnconfigure(0, weight=1)
|
||||
|
||||
@ -38,8 +37,8 @@ for i in range(0, 18, 1):
|
||||
fg_color="#228da8")
|
||||
b.grid(row=i, column=0, pady=5, padx=15, sticky="nsew")
|
||||
|
||||
b = customtkinter.CTkButton(f3, corner_radius=i, height=34, border_width=3, text=f"{i} {i - 3}",
|
||||
fg_color=None, border_color="gray10", text_color="black")
|
||||
b = customtkinter.CTkButton(f3, corner_radius=i, height=34, border_width=2, text=f"{i} {i-2}",
|
||||
fg_color=None, border_color="gray20", text_color="black")
|
||||
b.grid(row=i, column=0, pady=5, padx=15, sticky="nsew")
|
||||
|
||||
b = customtkinter.CTkButton(f4, corner_radius=i, height=34, border_width=0, text=f"{i}",
|
||||
|
29
test/test_string_dialog.py
Normal file
29
test/test_string_dialog.py
Normal file
@ -0,0 +1,29 @@
|
||||
import customtkinter
|
||||
import tkinter
|
||||
|
||||
customtkinter.set_appearance_mode("light")
|
||||
customtkinter.set_default_color_theme("dark-blue")
|
||||
|
||||
app = customtkinter.CTk()
|
||||
app.geometry("400x300")
|
||||
app.title("CTkDialog Test")
|
||||
|
||||
|
||||
def change_mode():
|
||||
if customtkinter.get_appearance_mode().lower() == "dark":
|
||||
customtkinter.set_appearance_mode("light")
|
||||
elif customtkinter.get_appearance_mode().lower() == "light":
|
||||
customtkinter.set_appearance_mode("dark")
|
||||
|
||||
|
||||
def button_click_event():
|
||||
dialog = customtkinter.CTkDialog(master=None, text="Type in a number:", title="Test")
|
||||
print("Number:", dialog.get_input())
|
||||
|
||||
|
||||
button = customtkinter.CTkButton(app, text="Open Dialog", command=button_click_event)
|
||||
button.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
|
||||
c1 = customtkinter.CTkCheckBox(app, text="dark mode", command=change_mode)
|
||||
c1.place(relx=0.5, rely=0.8, anchor=tkinter.CENTER)
|
||||
|
||||
app.mainloop()
|
Reference in New Issue
Block a user