[squeak-dev] The Inbox: DesktopBackgroundLoader-sbw.20.mcz

Steve Wessels steve at squeak.preeminent.org
Sun Apr 25 15:58:05 UTC 2010


I just saw your work and like it.  Thank you.  I just published an  
update of my background loader to the inbox using this scheme.  That  
removes it's impact on other system code and now it installs clean.


On Apr 25, 2010, at 10:16 AM, Balázs Kósi wrote:

> Hi,
>
>> Now that the simple thing is in place, it's time to refactor so add- 
>> on packages can add menu entries without having to modify existing  
>> packages. Your's is the first to want to do so, there was no need  
>> before (even though it was foreseeable).
>
> My first stab at the problem is in The Inbox: Morphic-kb.248
> I wrote some explanation about how it works in the commit message [1].
> It uses pragmas to fill the docking bar. I tried to keep it simple.
> What do you think?
>
> Balázs
>
> [1] I copy the commit message here:
>
> First stab at refactoring TheWorldMainDockingBar to allow external
> packages to insert new menus, or menu items. We use two pragmas to
> fill the docking bar.
>
> A method in TheWorldMainDockingBar marked with pragma:
> <createDockingBarMenuWithPriority: NN> will get a chance to build on
> the DockingBarMorph, which it gets as its sole argument.
>
> A method in TheWorldMainDockingBar marked with pragma:
> <fillDockingBarMenu: #MENUNAME priority: NN> will get a chance to
> build on a menu, which it gets as its sole argument, when someone
> calls TheWorldMainDockingBar >> fillMenu: menu with: #MENUNAME
>
> Priority controls the order in which these methods are called.
>
> Currently there are three menus filled with this technique: #tools,
> #extras, #help
>
> So if you want to add a new menu item to the #extras menu from your
> package, you'll need to create an extension method on
> TheWorldMainDockingBar containing the pragma <fillDockingBarMenu:
> #extras priority: 50>, and evaluate [TheWorldMainDockingBar
> updateInstances]
>
> You can find examples in TheWorldMainDockingBar.
>




More information about the Squeak-dev mailing list