Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Subclassing TheWorldMenu
Last updated at 9:35 pm UTC on 31 March 2017
If you want to have a customized version of a 'TheWorldMenu' in your MorphicProject you need to subclass it as well as MorphicProject and PasteUpMorph.

Example:

This are all newly create subclasses.

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



E.g.

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



MorphicProject4 initialize
needs to be defined. There you have to use a subclass of PasteUpMorph. E.g.

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



This is then the place to refer to TheWorldMenu4 in the method

 buildWorldMenu: evt

Like this

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


In addition you may subclass TheWorldMainDockingBar and then override the method
dockingBar
in PasteUpMorph4
to get a specialized menu bar.

 dockingBar
	^ self
		projectParameterAt: #dockingBar
		ifAbsent: [TheWorldMainDockingBar4 instance]