mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
fixed bug when resizing CTkButton and CTkEntry in grid, added auto resizing to CTkSlider and CTkProgressBar, changed Readme
This commit is contained in:
@ -5,7 +5,7 @@ customtkinter.set_appearance_mode("System") # Modes: "System" (standard), "Dark
|
||||
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.geometry("400x340")
|
||||
root_tk.title("CustomTkinter Test")
|
||||
|
||||
|
||||
@ -21,27 +21,29 @@ def check_box_function():
|
||||
print("checkbox_1:", checkbox_1.get())
|
||||
|
||||
|
||||
frame_1 = customtkinter.CTkFrame(master=root_tk, width=300, height=260, corner_radius=15)
|
||||
frame_1.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
|
||||
y_padding = 13
|
||||
|
||||
frame_1 = customtkinter.CTkFrame(master=root_tk, corner_radius=15)
|
||||
frame_1.pack(pady=20, padx=60, fill="both", expand=True)
|
||||
|
||||
label_1 = customtkinter.CTkLabel(master=frame_1)
|
||||
label_1.place(relx=0.5, rely=0.1, anchor=tkinter.CENTER)
|
||||
label_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
progressbar_1 = customtkinter.CTkProgressBar(master=frame_1)
|
||||
progressbar_1.place(relx=0.5, rely=0.25, anchor=tkinter.CENTER)
|
||||
progressbar_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
button_1 = customtkinter.CTkButton(master=frame_1, corner_radius=10, command=button_function)
|
||||
button_1.place(relx=0.5, rely=0.4, anchor=tkinter.CENTER)
|
||||
button_1.pack(pady=y_padding, padx=10)
|
||||
# button_1.configure(state="disabled")
|
||||
|
||||
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.pack(pady=y_padding, padx=10)
|
||||
slider_1.set(0.5)
|
||||
|
||||
entry_1 = customtkinter.CTkEntry(master=frame_1)
|
||||
entry_1.place(relx=0.5, rely=0.75, anchor=tkinter.CENTER)
|
||||
entry_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
checkbox_1 = customtkinter.CTkCheckBox(master=frame_1, command=check_box_function)
|
||||
checkbox_1.place(relx=0.5, rely=0.9, anchor=tkinter.CENTER)
|
||||
checkbox_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
root_tk.mainloop()
|
||||
|
Reference in New Issue
Block a user