When I open a Popup
with the FileChooser
I can select a file, but I cannot close the Popup
after it. Does anyone have any idea on how to close the Popup
when reference from another class?
class MyFileChooser(FileChooserListView):
def on_submit(*args):
fp=args[1][0]
class MainScreen(BoxLayout):
def filebtn(self, instance):
self.popup = Popup(title='Select File',
content=MyFileChooser(),
size_hint=(None, None), size=(400, 400))
self.popup.open()
def __init__(self, **kwargs):
super(MainScreen, self).__init__(**kwargs)
self.orientation = 'vertical'
self.btnfile = Button(text='Open File')
self.btnfile.bind(on_press=self.filebtn)
self.add_widget(self.btnfile)
I've tried doing
class MyFileChooser(FileChooserListView):
def on_submit(*args):
fp=args[1][0]
popup.dismiss()
But that doesn't work so I'm lost. Any help would be appreciated.