Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Subclassing MorphicProject, TheWorldMenu and PasteUpMorph
Last updated at 11:28 am UTC on 28 April 2019
A Morphic world can be customized by subclassing these closely related classes

Example

Suppose you wish to create a new project type called Meta by extending Morphic.
MorphicProject subclass: #MetaProject
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Meta-Project'

PasteUpMorph subclass: #MetaPasteUpMorph
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Meta-Morphic'

TheWorldMenu subclass: #MetaWorldMenu
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Meta-WorldMenu'

TheWorldMainDockingBar subclass: MetaWorldMainDockingBar
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Meta-WorldMenu'

In these new classes, you might want to customize the following methods:
For instance in MetaPasteUpMorph:
buildWorldMenu: evt
	^(MetaWorldMenu new
		world: self
		project: (self project ifNil: [Project current])       
		hand: evt hand) buildWorldMenu

or the method
dockingBar
in MetaPasteUpMorph:
dockingBar
	^self
		projectParameterAt: #dockingBar
		ifAbsent: [MetaWorldMainDockingBar instance]


See also

MorphicProject subclass: #EtoysProject