Dynamic open menu
Last updated at 6:04 pm UTC on 14 January 2006
With changeset 5105 (SqueakMapHooks-sw) a dynamic portion to Dynamic open menu was added. Scamper, Celeste, and IRC, and SqueakMap appear in the dynamic portion of the menu; when they are removed from the system, they disappear from the menu; when they return, they reappear in the menu.
Participation in the dynamic portion of the open menu requires the implementation of three methods in clients:
1. The GUI class #initialize should call #registerOpenCommand:.
2. The GUI class #unload should call #unregisterOpenCommand:,
3. And it should have some unary message to open the GUI.
It is possible to Provide balloon help for all the items in the open menu, including the dynamic ones.
A typical initialization method of a client package which likes to install a menu entry in Dynamic open menu looks like this:
Class SMLoader
initialize
(Dynamic open menu respondsTo: #registerOpenCommand:)
ifTrue: [TheWorldMenu registerOpenCommand: {'Package Loader'. {self. #open}}].
The code to unregister:
removeFromSystem
(TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue:
[TheWorldMenu unregisterOpenCommand: 'Package Loader'].
super removeFromSystem