Pharo 7: Problems with the new file chooser UI
Hi, 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: [1]~~~~ (FileLocator documents / 'test.ston') ensureCreateFile writeStreamDo: [:stream | STON put: (Rectangle center: 10@10 extent: 100@50) onStream: stream ]. ~~~~ You will get a file on your Documents folder called test.ston, but If I choose that file using: [2]~~~~ 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? Thanks, Offray
Are you really sure ? It works for me, Pharo 7.0.1 macOS.
On 18 Feb 2019, at 22:57, Offray Vladimir Luna Cárdenas <offray.luna@mutabit.com> wrote:
Hi,
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:
[1]~~~~
(FileLocator documents / 'test.ston') ensureCreateFile writeStreamDo: [:stream | STON put: (Rectangle center: 10@10 extent: 100@50) onStream: stream ].
~~~~
You will get a file on your Documents folder called test.ston, but If I choose that file using:
[2]~~~~
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?
Thanks,
Offray
Hi Sven, Yes I was sure. But that's because I was using Pharo-7.0.0+rc1.build.19.sha.1fcbcd5170ad that was the one loaded from Pharo launcher 1.6.x from 31.01.2019. Now I have updated Pharo Launcher to 1.7.2 and it makes available the 7.0.1 versions of Pharo and now that functionality is working well... I just deal with other dependencies and changes... But Grafoscopio is taking better form now. Cheers, Offray On 18/2/19 17:13, Sven Van Caekenberghe wrote:
Are you really sure ? It works for me, Pharo 7.0.1 macOS.
On 18 Feb 2019, at 22:57, Offray Vladimir Luna Cárdenas <offray.luna@mutabit.com> wrote:
Hi,
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:
[1]~~~~
(FileLocator documents / 'test.ston') ensureCreateFile writeStreamDo: [:stream | STON put: (Rectangle center: 10@10 extent: 100@50) onStream: stream ].
~~~~
You will get a file on your Documents folder called test.ston, but If I choose that file using:
[2]~~~~
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?
Thanks,
Offray
participants (2)
-
Offray Vladimir Luna Cárdenas -
Sven Van Caekenberghe