-
-
Notifications
You must be signed in to change notification settings - Fork 407
Open
Labels
Description
makeAScreenshot is now in morphic but we could have it at the level of Spec.
makeAScreenshot
| filePrefix |
filePrefix := 'PharoScreenshot'.
(MorphicUIManager new
chooseFrom: {
'The entire world' translated.
'A selected area' translated }
values: #( #world #area )
message:
'What do you want to shoot? (File will be saved in image directory)'
translated
title: 'Make a screenshot') ifNotNil: [ :choice |
| form name |
form := choice = #world
ifTrue: [ self currentWorld imageForm ]
ifFalse: [ Screenshot new formScreenshotFromUserSelection ].
name := (FileSystem workingDirectory / filePrefix , 'png')
nextVersion.
PNGReadWriter
putForm: form
onFileNamed:
(FileSystem workingDirectory / filePrefix , 'png') nextVersion.
MorphicUIManager new
inform: (String streamContents: [ :s |
s
nextPutAll: 'Screenshot saved under ';
nextPutAll: name fullName;
cr;
nextPutAll: 'Click to open location' ])
actionOnClick: [ name openInOSFileBrowser ] ]