Hi,
On 18 Mar 2019, at 20:27, ducasse <stepharo@netcourrier.com> wrote:
On 18 Mar 2019, at 18:00, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi Sean,
This is how the menus are done ultimately, not âthe wayâ of doing it. In general, you will do menus using something like Commander: you define commands, then you dynamically build the menus based on a context given (this is how Pharo itself will doit). - Or you build your own command library and build menus your way (see this experiment: https://github.com/estebanlm/Lieutenant/tree/try-superlight-version and its clases LtMenuBarBuilder, LtContextMenuBuilder). - Or you collect the items (MenuItemPresenter) from a pragma and you sort them some way.
You are free to do as you want, but at the end, it has to have the structure described in the log :)
I think that Spec should propose a nice default way.
We will have a default way. But everybody can do whatever they want after that :)
And as Sean mentioned it, Iâm not unable to nicely extend Epicea menu so Iâm hacking inside and this is not good.
Because it was not designed to be extensible (as nothing was before we started to pay attention to that) Esteban
One important things I didnât remarked, is that in Spec, all menu accessors are âvaluablesâ. Means that for example ListPresenter>>contextMenu: will receive anything that understands value and it will be executed on demand:
self newList contextMenu: [ self collectMyContextMenu ]; etcâ¦.
Will work as expected. (I hope this helps to understand the design better).
Cheers! Esteban
On 18 Mar 2019, at 17:06, Sean P. DeNigris <sean@clipperadams.com> wrote:
EstebanLM wrote
addGroup: [ :group | group addItem: [ :item | item name: 'Something 1'; action: [ "doSomething"] ];
How would one extend a menu with this approach e.g. add an item to the group from elsewhere (outside the block)? Is it even possible?
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html