[squeak-dev] Project saving does not work

Vaidotas Didžbalis vaidasd at gmail.com
Thu Apr 28 12:29:34 UTC 2022

Hello list,
Project saving does not work. I'm using update: #21659: The first walkback
is because of instance of the ScrapBook has value of wrong type, attached
changeset fixes this, but then, trying to save further system warns that
"some block(s) which reference instance variables are included in this
segment", and if user proceeds, Squeak shows MNU exception and, if user
closes exception window Squeak becomes sluggish -- not all menu items will
be selectable, user will not be able to write in the Workspace (you need to
press key sever times in order to for letter to be displayed).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220428/1c48aea1/attachment.html>
-------------- next part --------------
'From Squeak6.0alpha of 26 April 2022 [latest update: #21659] on 28 April 2022 at 3:24:38 pm'!
"Change Set:		Unnamed1
Date:			27 April 2022
Author:			Vaidotas Didžbalis

<your descriptive text goes here>"!

!ScrapBook methodsFor: 'scraps' stamp: 'vd 4/27/2022 16:00'!
	| header aButton label |
		book := BookMorph new pageSize: 300 at 300; setNameTo: 'scraps' translated.
		book addCornerGrips.
		book color: Color yellow muchLighter.
		book borderColor: Color darkGray; borderWidth: 2.
		book removeEverything; showPageControls; insertPage.

		header := AlignmentMorph newRow wrapCentering: #center; cellPositioning: #leftCenter.
		header setProperty: #header toValue: true.
		header addMorph: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Collapse').
		aButton target: book;
			actionSelector: #delete;
			setBalloonText: 'Close the trashcan.\(to view again later, click on any trashcan).' translated withCRs.
		header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
		header addMorphBack: 	(label := UpdatingStringMorph new target: self) beSticky.
		label getSelector: #trashTitle; useStringFormat; step.
		header addMorphBack: AlignmentMorph newVariableTransparentSpacer beSticky.
		header addMorphBack: (aButton := ThreePhaseButtonMorph labelSymbol: #'Halo-Dismiss').
		aButton target: self;
			actionSelector: #maybeEmptyTrash;
			setBalloonText: 'Click here to empty the trash.' translated.
		book currentPage
			layoutPolicy: TableLayout new;
			addMorph: (TextMorph new
				contents: 'Objects you drag into the trash will automatically be saved here, one object per page, in case you need them later.  To disable this feature set the "preserveTrash" Preference to false.\\You can individually expunge objects by hitting the "-" control (behind "..."). You can empty out all the objects in the trash can by hitting the "X" button at top right.' translated withCRs;
				hResizing: #spaceFill).

		book addMorphFront: header.
		book setProperty: #scraps toValue: true! !

!ScrapBook methodsFor: 'scraps' stamp: 'vd 4/27/2022 16:03'!
	| oldScraps |
	oldScraps := book.
	self createFreshBook.
	(oldScraps notNil and: [oldScraps owner notNil])
			[book position: oldScraps position.
			oldScraps owner replaceSubmorph: oldScraps by: book.
			book changed; layoutChanged]! !

!ScrapBook methodsFor: 'scraps' stamp: 'vd 4/27/2022 16:01'!
	book ifNil: [self createFreshBook].
	^ book! !

Leave the line above, and replace the rest of this comment by a useful one.
Executable statements should follow this comment, and should
be separated by periods, with no exclamation points (!!).
Be sure to put any further comments in double-quotes, like this one."
ScrapBook allInstancesDo: [:each | (each scrapBook isKindOf: BookMorph) ifFalse:[each createFreshBook]].

More information about the Squeak-dev mailing list