[Pharo-users] Pharo 7: Problems with the new file chooser UI

Offray Vladimir Luna Cárdenas offray.luna at mutabit.com
Mon Feb 18 16:57:19 EST 2019


While I'm migrating Grafoscopio to Pharo 7 I get a deprecation warning
telling me that I need to change the previous code for choosing a file
from the UI, but now when I proceed as advised (using
|chooseExistingFileReference: title extensions: exts path: path|). It
returns a |FileReference| but all the paths are referred to the place
where the running image is located, instead of the place where the
selected file is located.

For example if you run:


(FileLocator documents / 'test.ston') ensureCreateFile  writeStreamDo: 
[:stream | STON put: (Rectangle center: 10 at 10 extent: 100 at 50) onStream:
stream ].


You will get a file on your Documents folder called test.ston, but If I
choose that file using:


file := UIManager default
                        chooseExistingFileReference:'Choose a file'
                        extensions: #('ston')
                        path: FileLocator documents.


and I choose the "test.ston" file created at [1], Pharo tells me that
the file is located in the same place as the running image, instead on
my Documents folder.

Am I missing something?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190218/209723de/attachment.html>

More information about the Pharo-users mailing list