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 2:54 am UTC on 8 June 2018
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

Mailing thread discussion MorphicProject subclass: #EtoysProject