[COTDC] 26 - PickAFileToWriteNotification

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[COTDC] 26 - PickAFileToWriteNotification

laurent laffont
Today:  PickAFileToWriteNotification


Comment Of The Day Contest - One Day One Comment
Rules: 
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Laurent
Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 26 - PickAFileToWriteNotification

Fernando olivero-2
I'm a notification, with an unclear purpose because I have no senders
in the image.
I should probably be removed from the system.

On Sun, Mar 6, 2011 at 9:29 PM, laurent laffont
<[hidden email]> wrote:
> Today:  PickAFileToWriteNotification
>
> Comment Of The Day Contest - One Day One Comment
> Rules:
> #1: Each day a not commented class is elected. Each day the best comment
> will be integrated with name of the author(s).
> #2: If you cannot comment it, deprecate it.
> Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest
> Laurent

Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 26 - PickAFileToWriteNotification

carlo.t
In reply to this post by laurent laffont
I provide a way to indicate that an object would like a file to write to.

You can use me as follows:
| file |
[file := PickAFileToWriteNotification signal. file inspect] on: PickAFileToWriteNotification do: [:ex | | newFileName stream | newFileName := FillInTheBlankMorph request: 'Name of file to write:' translated initialAnswer: 'xxx'. stream := FileStream fileNamed: newFileName. stream ifNotNil: [ex resume: stream]]


On 06 Mar 2011, at 11:29 PM, laurent laffont wrote:

Today:  PickAFileToWriteNotification


Comment Of The Day Contest - One Day One Comment
Rules: 
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Laurent

Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 26 - PickAFileToWriteNotification

laurent laffont
Indeed there's no reference in Pharo.

In Squeak it is used by PostscriptEncoderToDisk and DSCPostscriptCanvasToDisk  which don't exist in Pharo.

So I suppose that it can be safely removed.

Thanks Fernando & Carlo (I like the code snippet). 

Laurent.

On Mon, Mar 7, 2011 at 1:13 AM, Carlo <[hidden email]> wrote:
I provide a way to indicate that an object would like a file to write to.

You can use me as follows:
| file |
[file := PickAFileToWriteNotification signal. file inspect] on: PickAFileToWriteNotification do: [:ex | | newFileName stream | newFileName := FillInTheBlankMorph request: 'Name of file to write:' translated initialAnswer: 'xxx'. stream := FileStream fileNamed: newFileName. stream ifNotNil: [ex resume: stream]]


On 06 Mar 2011, at 11:29 PM, laurent laffont wrote:

Today:  PickAFileToWriteNotification


Comment Of The Day Contest - One Day One Comment
Rules: 
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Laurent