I have this code for TKinter and CustomTkinter to create a file upload button:
def import_file_data():
v = tk.StringVar()
global file_data
csv_file_path = askopenfilename()
v.set(csv_file_path)
file_data = pd.read_csv(csv_file_path)
file_button = ctk.CTkButton(root, text = "File Upload", command=import_file_data)
file_button.grid(row=5,column=0, padx=buttonx, pady=buttony)
This button is blue with white text by default and I want to make it so it turns green on the click action of the button to signify that a file was successfully uploaded.
I know Tkinter offers a .after
function which might help. Does anyone know how to do this?