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 12:04 pm UTC on 24 February 2018
If you want to for example to have a customized version of a 'World menu' in your MorphicProject you need to make a subclass of the class 'TheWorldMenu'.

In addition you need to create a subclass of MorphicProject and PasteUpMorph in order to make it work.

Example


TheWorldMenu subclass: #TheWorldMenu4
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'MyCustomisations-WorldMenu'



MorphicProject subclass: #MorphicProject4
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'MyCustomisations-Project'



PasteUpMorph subclass: #PasteUpMorph4
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'MyCustomisations-Project'



Methods to you might want to add in the newly created subclasses:





MorphicProject4 initialize
needs to be defined. Instead of using the class PasteUpMorph use PasteUpMorph4

And in method

 buildWorldMenu: evt

of PasteUpMorph4 you have to refer to refer to TheWorldMenu4

PasteUpMorph4
 buildWorldMenu: evt
 	^(TheWorldMenu4 new
 		world: self
 		project: (self project ifNil: [Project current])       
 		hand: evt hand)buildWorldMenu.


To get a specialized menu bar you need to subclass TheWorldMainDockingBar and then override the method
dockingBar
in PasteUpMorph4
 dockingBar
	^ self
		projectParameterAt: #dockingBar
		ifAbsent: [TheWorldMainDockingBar4 instance]