Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
TheWorldMenu
Last updated at 3:29 am UTC on 18 July 2018
An instance of the class TheWorldMenu is shown as a World menu when the user clicks the Red button on the desktop [1].

How to create a custom world menu for the current project and subprojects.

Implementation note

The

 invokeWorldMenu: evt

method is used to bring up the TheWorldMenu object. The call is implemented at the bottom of the mouse handler method of PasteUpMorph>>mouseDown:

Later on that results in a call to (PasteUpMorph object)

 buildWorldMenu: evt
	^(TheWorldMenu new
		world: self
		project: (self project ifNil: [Project current])       "mvc??"
		hand: evt hand) buildWorldMenu.



[1].
Actually the desktop a PasteUpMorph object.
This object may be accessed with
 Project current world
in a Workspace.

2017


Cuis maintains the class TheWorldMenu.

Squeak 5.1
 TheWorldMenu selectors size 96
 TheWorldMenu class selectors size  9

Cuis5.0-3068
 TheWorldMenu selectors size  41 
 TheWorldMenu class selectors size  0 


So reading code in Cuis can help you to better understand what is going on in Squeak.

TheWorldMenu saveWorldInFile

For an example where the world menu is fully adapted to the needs of the project see Musical objects for Squeak.

2006


The following code snippet leads you to a point of departure for reading the code for TheWorldMenu.

(TheWorldMenu new
	world: World
	project: Project current  
	hand: World currentHand) 
buildWorldMenu openInWorld.

The message #openInWorld is sent here to the instance of the class TheWorldMenu just for demonstration purposes. The menu shows up in the upper left corner.

Look at PasteUpMorph>>buildWorldMenu: to see how the menu is used in context.

The method #buildWorldMenu of the class Dynamic open menu is the entry point worth exploring.

A part of the world menu is now dynamic. Your own application can register for an entry in the world menu (see Dynamic open menu for details)

Collaboration diagram for 3.8g made with the BabySRE tool (Trygve Reenskaug)

Uploaded Image: MenuMorph-Collaboration2.gif