thats the program in python using tkinter and customtkinter:
import customtkinter
def login():
if email_entry.get() == "admin" and password_entry.get() == "password":
message_label.configure(text="Login successful!")
else:
message_label.configure(text="Invalid username or password")
def sign_user():
print('open another page and make the log')
def help_user():
print('forget password?')
# window
window = customtkinter.CTk()
window.title("Agenda de Rotina")
window.geometry('500x300+710+390')
window.resizable(False, False)
customtkinter.set_appearance_mode('dark')
#create the frame to email and password
frame_1 = customtkinter.CTkFrame(window)
frame_1.pack(pady=(70, 5))
# create the email and password entry widgets
email_label = customtkinter.CTkLabel(frame_1, text="E-mail:")
email_label.grid(row=0, column=0, padx=5, pady=5)
email_entry = customtkinter.CTkEntry(frame_1)
email_entry.grid(row=0, column=1, padx=5, pady=5)
password_label = customtkinter.CTkLabel(frame_1, text="Password:")
password_label.grid(row=1, column=0, padx=5, pady=5)
password_entry = customtkinter.CTkEntry(frame_1)
password_entry.grid(row=1, column=1, padx=5, pady=5)
# create the login button
login_button = customtkinter.CTkButton(window, text="Login", command=login)
login_button.pack(pady = 10)
# create a label for displaying messages
message_label = customtkinter.CTkLabel(window, text="")
message_label.pack()
# create the frame to the sign and help? button
frame_2 = customtkinter.CTkFrame(window)
frame_2.pack(pady = 10)
# create the sign and need help? button
sign_button = customtkinter.CTkButton(frame_2, text = 'Sign', width = 100, command = sign_user)
sign_button.grid(row = 0, column = 0, padx = (0, 10))
help_button = customtkinter.CTkButton(frame_2, text = 'Help?', width = 100, command = help_user)
help_button.grid(row = 0, column = 1, padx = (10, 0))
window.mainloop()
and i used this appearance_mode:
customtkinter.set_appearance_mode('dark')
but i want to to my frame background color be the same as my bg window. I have tried to set, but doesn't work.
my_window_dark = '#242424'
# and i put the variable in the frame
frame_1 = customtkinter.CTkFrame(window, bg_color = 'my_window_dark')
frame_1.pack(pady=(70, 5))
and when i just put a random color to see what hapens:
i tried to creat a variable to the color and them put that variable in the color method of the frame, and get an error. Also when i put a random color that is in the lib, appear the image that i put above
You can simply use the special color "transparent":
frame_1 = customtkinter.CTkFrame(window, fg_color="transparent")