[Cuis-dev] WorldMenu

Hilaire Fernandes hilaire at drgeo.eu
Sat May 28 02:23:39 PDT 2022


Hi Hernan,

Le 27/05/2022 à 19:17, Hernan Wilkinson a écrit :
> I like the idea of building the menu and its submenus.
> I don't like pragmas that much... I think that having just a selector 
> as the DynamicMenuBuilder does is enough.

As long as there is no argument in the pragma, a selector will do the 
same thing, if I am right. If you add arguments to the pragma it is 
different, for example with title and parent menu reference:

<drgeoMenu: 'Title' parent: #main>

Nevertheless, you can have this information as argument to the menu 
builder and it avoids using pragma.

Beside the definition of menu and submenus, the core idea is to have a 
menu builder instance passed along the methods defining the menu.

Another interest of the builder is to have just one pragma (<worldMenu>) 
or method name (#worldMenuSpec: aBuilder) for the whole menu hierarchy, 
and a different name for each menu and submenus.

You will defined the World menu with some code as :

world worldState menuSpec: #worldMenuSpec:

And for DrGeo, I will rewrite it:

world worldState menuSpec: #drgeoMenuSpec:

The builder will then sort out all the menu spec and reorder it as menu 
and submenus. Alternative subclass builder may build differently the 
menu: top bar menus, circular menus, voice recognition, etc.

Hilaire

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu



More information about the Cuis-dev mailing list