Well, that's the way it was designed, to answer a file stream to which the file contents can be added.
Could be extended to support choosing file name (not file) to save to.

I expect your exportWith uses #putForm:onFileNamed: whereas it could use #putForm:onStream: instead.

Regards, Gary

----- Original Message ----- From: "Alexandre Bergel" <[email protected]>
To: "Pharo Development" <[email protected]>
Sent: Monday, June 20, 2011 7:02 PM
Subject: [Pharo-project] UITheme builder fileSave:...


Hi!

I would like to use the builder to have a file selection. Here is my code:

-=-=--=-=-=--=-=-=--=-=-=--=-=-=--=
interactiveExportWith: imageWriterClass extension: fileExtension
"Ask for a file name and a directory"

| fileStream |
fileStream := UITheme builder
fileSave: 'Your title here'
extensions: #('png')
path: nil.

"Very strange that I obtain a stream".
fileStream ifNil: [ self inform: 'saving aborded'. ^ self ].
fileStream close.
FileDirectory deleteFilePath: fileStream name.
self exportWith: imageWriterClass fullname: fileStream name.
-=-=--=-=-=--=-=-=--=-=-=--=-=-=--=

I have no idea why fileSave:extensions:path: return a stream. If I just need a full file name ?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.








Reply via email to