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:
- MetaProject
- initialize
- Remember to use MetaPasteUpMorph instead of PasteUpMorph
- initializeProjectPreferences
- configureOnFirstEntry
-
- finalExitActions:
- MetaPasteUpMorph
- buildWorldMenu: evt
- Remember to refer to MetaWorldMenu, if customized
- dockingBar
- Remember to use MetaWorldMainDockingBar, if customized
- MetaWorldMenu
- TheWorldMainDockingBar
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