[Pharo-dev] Esteban's ChangeLog week of 11 March 2019

Esteban Lorenzano estebanlm at gmail.com
Mon Mar 18 17:26:01 EDT 2019


Hi,

> On 18 Mar 2019, at 20:27, ducasse <stepharo at netcourrier.com> wrote:
> 
> 
> 
>> On 18 Mar 2019, at 18:00, Esteban Lorenzano <estebanlm at 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 at 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
>>> 
>> 
>> 
> 
> 
> 




More information about the Pharo-dev mailing list