![]() |
2010-01-08
, 11:58
|
|
Posts: 319 |
Thanked: 289 times |
Joined on Sep 2009
@ Lisboa, Portugal
|
#2
|
![]() |
2010-01-08
, 12:10
|
Posts: 547 |
Thanked: 1,383 times |
Joined on Sep 2009
@ Stockholm, Sweden
|
#3
|
self.bAttachment = hildon.Button(gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_HORIZONTAL, "Attachment") self.bAttachment.connect('clicked', self.open_file_dialog)
def open_file_dialog(self, button): #fsm = hildon.FileSystemModel() #fcd = hildon.FileChooserDialog(self.window, gtk.FILE_CHOOSER_ACTION_OPEN, fsm) # this shouldnt issue a warning according to the pymaemo mailing list, but does # anyway, nfc why :( fcd = gobject.new(hildon.FileChooserDialog, action=gtk.FILE_CHOOSER_ACTION_OPEN) fcd.set_default_response(gtk.RESPONSE_OK) ret = fcd.run() if ret == gtk.RESPONSE_OK: self.bAttachment.set_label(fcd.get_filename()) self.update_size(fcd.get_filename()) fcd.destroy() else: fcd.destroy()
The Following 2 Users Say Thank You to frals For This Useful Post: | ||
![]() |
2010-01-08
, 12:15
|
|
Posts: 319 |
Thanked: 289 times |
Joined on Sep 2009
@ Lisboa, Portugal
|
#4
|
I want to press a button, open a filen dialog that I can browse through directorios and select a file, then this would return the path of that file.
Also would be nice to know if I could filter, lets say just text files...
thanks