Thx i will try it and i tell you after if found a solution
The filechooser.selection doesn't work.
Well, I assumed the same J So what to do?
i have no idea of how to solve that
The problem is in the file <kivy location>/kivy/kivy/uix/fileChooser.py
If you set multiselect=true (to say, you left it on defalut multiselect=false) the line 193 gives you an EMPTY selection list.
But now as i look at it, it’s pretty clear what the idea is : the file path and name aren’t actually stored in fileChooser.selection then, but in fileChooser.path ;-)
When you select multiselection, the fileCHooser.selection gives you the required value ;-)
Did you understand so far ? à for single file selection (default) choose fileChooser.path. for multiselection take the fileChooser.selection property.
Hope that helped. I’ll try it out right now.
Cyril Stoller
Sorry, little fault:
The problem is in the file <kivy location>/kivy/kivy/uix/fileChooser.py
If you didn’t set multiselect=true (to say, you left it on defalut multiselect=false) the line 193 gives you an EMPTY selection list.
But now as i look at it, it’s pretty clear what the idea is : the file path and name aren’t actually stored in fileChooser.selection then, but in fileChooser.path ;-)
When you select multiselection, the fileCHooser.selection gives you the required value ;-)
Did you understand so far ? à for single file selection (default) choose fileChooser.path. for multiselection take the fileChooser.selection property.
Hope that helped. I’ll try it out right now.
Cyril Stoller
Von: kivy-...@googlegroups.com [mailto:kivy-...@googlegroups.com] Im Auftrag von Jean Claude Twagiramungu
Gesendet: Samstag, 1. Oktober 2011 15:54
An: kivy-...@googlegroups.com
Betreff: Re: AW: filechooser
i have no idea of how to solve that
I don't really understand may be you can give me an example when you will try it and if it work
Ok, sorry another time. This idea was just shit. The fileChooser.py actually works like the following:
if i select an entry (line 166) and the entry is a file (line 178) and not a directory, the event « on_submit » is fired by the fileChooser object. This is just like with a button object – you can now bind this event to a custom function :
if you created the following:
filechooserinstance = fileChooser()
you can bind it with:
filechooserinstance.bind(on_submit=self.whateverfunction)
and then later on in your actual class :
def whateverfunction(self, fileChooserInstance, selected, touch) # <selected> is a list containing only one entry : your filename.
print selected[0] # and your done.
I appended you the file that works now great here.
Ok great a lot i will try it
When you found something unclear in the documentation, it would be
über nice if you can do the change, and send us a pull request in
github.
Or at least, report a bug report. Then we can imrpove the documentation :)
Can you do it for that one ?
Thanks,
Mathieu
2011/10/1 Cyril Stoller <cyril....@gmail.com>:
Ok i will do that