Compare commits

..

2 Commits

View File

@ -213,8 +213,16 @@ with col1:
root = tk.Tk()
root.withdraw()
root.wm_attributes('-topmost', 1)
root.after(10) # Add a small delay
# Create and run the main loop in a way that doesn't block
path_holder = []
def select_dir():
path = filedialog.askdirectory(title="Select Source Directory")
if path:
path_holder.append(path)
root.quit()
root.after(20, select_dir)
root.mainloop()
if path_holder and path_holder[0]:
st.session_state['source_dir_selected'] = path
st.rerun()
root.destroy()
@ -262,8 +270,16 @@ with col1:
root = tk.Tk()
root.withdraw()
root.wm_attributes('-topmost', 1)
root.after(10) # Add a small delay
# Create and run the main loop in a way that doesn't block
path_holder = []
def select_dir():
path = filedialog.askdirectory(title="Select Destination Directory")
if path:
path_holder.append(path)
root.quit()
root.after(20, select_dir)
root.mainloop()
if path_holder and path_holder[0]:
st.session_state['dest_dir_selected'] = path
st.rerun()
root.destroy()