Maria
Maria

Reputation: 21

Delay for displaying path in entry field after using filedialog from tkinter

I am working on my (in my eyes) first larger project. Until this moment I was writing only scripts up to 500 lines and I am creating an app for my team which is going to do some quality control so I created simple gui for app to be user friendly and not to force everyone use CLI

I used tkinter and customtkinter. My app works more or less okayish but I am having some issues here while opening filedialog and choosing file

class MainsScreen(ctk.CtkFrame):
....
....

def select_folder(self):
    self.entry_export_file.delete(0, tk.END)
    self.entry_export_file.insert(0, Text.LOADING_MESSAGE) 
    self.update_idletasks() 
    folder_path = filedialog.askdirectory(title=Text.FILEDIALOG_CHOOSE_FOLDER,  initialdir="C:/")
    if folder_path:
        self.entry_export_file.delete(0, tk.END)
        self.entry_export_file.insert(0, folder_path)

after the dir is picked then I experience significant delay (about 5 seconds) until the path appears in entry field. I have put some dummy "Loading..." text there so It does not look that bad to user. This delay however bugs me and I was wondering if there is some solution. This is happening mostly when picking folder which is on OneDrive which I have been reading is the reason, but I have not found a workaround.

Upvotes: 0

Views: 46

Answers (0)

Related Questions