About Smalltalk ui icons...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

About Smalltalk ui icons...

stepharo
loadConfigurationButton: aList
     <menu>
     aList
         act: [ :presenter | self onLoadFrom: presenter ]
         icon: Smalltalk ui icons configIcon
         entitled: 'Load configuration (do not install project)'


why we could not have something like

loadConfigurationButton: aList
     <menu>
     aList
         act: [ :presenter | self onLoadFrom: presenter ]
         icon: #configIcon
         entitled: 'Load configuration (do not install project)'


and the class knows how to fetch it?


Reply | Threaded
Open this post in threaded view
|

Re: About Smalltalk ui icons...

EstebanLM

> On 22 May 2016, at 17:51, stepharo <[hidden email]> wrote:
>
> loadConfigurationButton: aList
>    <menu>
>    aList
>        act: [ :presenter | self onLoadFrom: presenter ]
>        icon: Smalltalk ui icons configIcon
>        entitled: 'Load configuration (do not install project)'
>
>
> why we could not have something like
>
> loadConfigurationButton: aList
>    <menu>
>    aList
>        act: [ :presenter | self onLoadFrom: presenter ]
>        icon: #configIcon
>        entitled: 'Load configuration (do not install project)’

in this case it should be called #act:iconNamed:entitled:, IMO.
but I was thinking and what I actually would do is to model the class Icon, and then you can add an extension to symbol “#asIcon” who call some "Icon fromSymbol: blah"

then the strategy of resolution can change without changing anything in the system :P

(I know you would not like #asIcon, but I think in this case it would be better than all those "Smalltalk ui icons iconNamed: blah" all around the image)

>
>
> and the class knows how to fetch it?
>
>


Reply | Threaded
Open this post in threaded view
|

Re: About Smalltalk ui icons...

stepharo


Le 22/5/16 à 20:44, Esteban Lorenzano a écrit :

>> On 22 May 2016, at 17:51, stepharo <[hidden email]> wrote:
>>
>> loadConfigurationButton: aList
>>     <menu>
>>     aList
>>         act: [ :presenter | self onLoadFrom: presenter ]
>>         icon: Smalltalk ui icons configIcon
>>         entitled: 'Load configuration (do not install project)'
>>
>>
>> why we could not have something like
>>
>> loadConfigurationButton: aList
>>     <menu>
>>     aList
>>         act: [ :presenter | self onLoadFrom: presenter ]
>>         icon: #configIcon
>>         entitled: 'Load configuration (do not install project)’
> in this case it should be called #act:iconNamed:entitled:, IMO.
yes
> but I was thinking and what I actually would do is to model the class Icon, and then you can add an extension to symbol “#asIcon” who call some "Icon fromSymbol: blah"
>
> then the strategy of resolution can change without changing anything in the system :P
>
> (I know you would not like #asIcon, but I think in this case it would be better than all those "Smalltalk ui icons iconNamed: blah" all around the image)
This is why I started also to add methods

iconNamed: aSymbol
     Smalltalk ui icons aSymbol

so that we can start to think and it will be easier to produce

iconNamed: aSymbol
     Icon fromSymbol: aSymbol


I HATE so much these bad bad bad global variable idea.
I think that this pattern is doomed.
We should have an object

This is the same for

     Smalltalk tools browser

Why the clients cannot get initialized with a tool context registry and
the code would be

     registry browser

We are accepting not so good design to my opinion and we are getting
spaghetti.

Stef


>>
>> and the class knows how to fetch it?
>>
>>
>
>