pharo-spec / Spec

Spec is a framework in Pharo for describing user interfaces.
MIT License
62 stars 64 forks source link

What about application on the class side of StPharoPresenter #1657

Closed Ducasse closed 46 minutes ago

Ducasse commented 2 hours ago

Hi

StPlaygroundPresenter class >>menuCommandOn: aBuilder
    <worldMenu>
    (aBuilder item: #Playground)
        parent: #InputOutput;
        action: [ StPharoApplication current tools workspace open ];
        order: 1;
        keyText: 'o, p';
        help: 'A window used as a scratchpad area where fragments of Pharo code can be entered, stored, edited, and evaluated.';
        iconName: #workspace

Now I was wondering is we could not have application on the classside of StPresenter. A first definition could be

StPresenter class >> application
     ^ StPharoApplication current
Ducasse commented 2 hours ago

@estebanlm what do you think about it? Like that we can factor out all these singletons access in a single place.

Ducasse commented 46 minutes ago

There is already currentApplication so I will use it. Now I do not like much the use of dynamic variables.