I'm very new to Kivy and through a lot of trial and error have gotten a pretty decent working app.
What I can't for the life of me figure out is how to get the FileChooser to update its path based on what I've selected (directory or otherwise).
.selection
always returns and empty list and .path
always returns the starting directory even after I have moved around. I'm missing some event somewhere and have spent a lot of time trying to figure this out and was hoping someone here could help.
I thought .selection
and .path
would update as I navigated but they seem stuck on their first/default values. I made the testbutton
just to see if I could get path or selection to print out/update.
This all gets triggered once they hit another button
def testbutton(self,test,iconview,*args):
print(test,iconview.path)
filepop=Popup(title='SaveFile')
FileChooserLayout=BoxLayout(orientation='vertical')
ButtonArea=BoxLayout(orientation='horizontal',spacing=50,size_hint=(.5,.5),pos_hint={'center_x': 0.5, 'center_y': 0.5})
listview=FileChooserListView(path='somepath',dirselect=True)
test=listview.path
testbutton=Button(text='test',on_press=partial(self.testbutton, test,iconview))
ButtonArea.add_widget(testbutton)
FileChooserLayout.add_widget(ButtonArea)
filepop.add_widget(FileChooserLayout)
Thanks for any help!