Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
MorphicProject subclass: #EtoysProject
Last updated at 12:04 pm UTC on 28 April 2019
A proposal on the mailing list
http://lists.squeakfoundation.org/pipermail/squeak-dev/2017-October/195420.html
suggests to create a project type EtoysProject as a subclass MorphicProject.

The steps are below.


1. Subclass MorphicProject


MorphicProject subclass: #EtoysProject
	instanceVariableNames: 'configured preferenceUndoList'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Project-Etoys


An boolean instance variable 'configured' is added which allows to configure a new EtoysProject on first entry.


2. Override method #finalEnterActions:


The method #finalEnterActions: needs to be overriden so that additional actions may be added.
Note that first call to
 	super finalEnterActions: leavingProject.
is called

finalEnterActions: leavingProject
	"Perform the final actions necessary as the receiver project is entered"

	super finalEnterActions: leavingProject.
	self saveGlobalPreferences.
	configured == true ifFalse: [
		self configureOnFirstEntry.
		configured := true ]


3. Call to #configureOnFirstEntry



configureOnFirstEntry
	"Set up initial preferences and playground"

	self flag: #TODO. "Add objects to the playground"



This is also the place where project parameters may be set for the specific project.


4. to be continued ...