So I have been coding this file explorer program. I have coded the copy function so far and the problem I am running into is that after I copy a file to its new directory(i.e. the directory that I am on currently in the filechooser) the file isn't showing up in the the actual filechooser. I am using the icon view and I saw only one mention of this online here:Refresh / Reload FileChooser and I tried this method and like the actual _update_files() function is getting executed.(checked it with a couple of print statements) But I am noticing that there is not any change in the actual filechooser.What am i doing wrong here? THANK YOU!!!
This is the python code that is executed when ever the file is copied. I assigned the actual screen that contains the file chooser to a variable named MainScreenVar
for i in range(0, self.execute_data_length):
if self.execute_data[i][2] == "File" :
shutil.copy2(self.execute_data[i][1], current_path)
MainScreenvar = MainScreen()
return MainScreenvar.ids.filechooser._update_files()
mycursor.execute("DELETE FROM selection")
mydb.commit()
This is part of the kivy file:
<MainScreen>:
FileChooserIconView:
id:filechooser
size_hint:1,.9
pos_hint:{"top": .9}
color: 0,0,0,0
and the source code for the kivy file chooser is here: https://kivy.org/doc/stable/_modules/kivy/uix/filechooser.html