Gary, IMHO, the correct result is the file name. First, Squeak's streams are, how do I put this nicely... Second, there are some plaform dependencies re ownership. Finally, somebody might want to try Nile. Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Gary Chambers Sent: Monday, January 25, 2010 9:57 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] [newbee] How do I save the contentsofaWorkspace? Actually rather more complicated than that... You'll want the full path I expect, also the correct OK button enablement... Any reason not to have the FileStream? Regards, Gary ----- Original Message ----- From: "Gary Chambers" <gazzaguru2@btinternet.com> To: <Pharo-project@lists.gforge.inria.fr> Sent: Monday, January 25, 2010 2:50 PM Subject: Re: [Pharo-project] [newbee] How do I save the contentsofaWorkspace?
Not at present. Have a look at FileDialogWindow. Perhaps you could add a couple of methods...
saveSelectedFile "Answer the name of the selected file or new filename or nil if blank."
|d f| d := self selectedFileDirectory ifNil: [^nil]. f := self selectedFileName ifNil: [self fileNameText withBlanksTrimmed]. ^f ifEmpty: [nil].
answerSaveFileName "Set the receiver to answer the selected/entered file name."
self actionSelector: #saveSelectedFileName. self changed: #okEnabled
Then, to open one...
|fd| fd := FileDialogWindow new title: title; answerSaveFileName. ^(modalParentMorph openModal: fd) answer
Choosing an appropriate modal owner. If you want, you could add the convenience methods to TEasilyThemed also...
Regards, Gary
----- Original Message ----- From: "George Herolyants" <george.herolyants@gmail.com> To: <Pharo-project@lists.gforge.inria.fr> Sent: Monday, January 25, 2010 12:37 PM Subject: Re: [Pharo-project] [newbee] How do I save the contents ofaWorkspace?
2010/1/25 Gary Chambers <gazzaguru2@btinternet.com>:
The base UIManager code has no accessors for file saving, though Polymorph does support such a dialog...
Try
UITheme builder fileSave: "Your dialog title here'
Thanks Gary! But is there a way to force this dialog to return just file name and not to create a file stream?
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project