Smalltalk ui icons vs iconNamed: vs @

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

Smalltalk ui icons vs iconNamed: vs @

Peter Uhnak
Hi,

My understanding is that now instead of

Smalltalk ui icons smallConfigurationIcon

I should do

Smalltalk ui iconNamed: #smallConfigurationIcon

This is however really unpractical, because it changes the operator priority, so I have to wrap it in parentheses every single time.

Button new
        icon: (... iconNamed: ...)

How about we add '@' or another binary selector so we can avoid the parentheses?

Peter

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk ui icons vs iconNamed: vs @

Henrik Nergaard
What about

Symbol >>#asIcon

   ^ Smalltalk ui icons iconNamed: self

Then one can do: "#add asIcon" ?

Best regards,
Henrik


-----Original Message-----
From: Pharo-dev [mailto:[hidden email]] On Behalf Of Peter Uhnak
Sent: Monday, May 30, 2016 4:34 PM
To: Pharo Development List <[hidden email]>
Subject: [Pharo-dev] Smalltalk ui icons vs iconNamed: vs @

Hi,

My understanding is that now instead of

Smalltalk ui icons smallConfigurationIcon

I should do

Smalltalk ui iconNamed: #smallConfigurationIcon

This is however really unpractical, because it changes the operator priority, so I have to wrap it in parentheses every single time.

Button new
        icon: (... iconNamed: ...)

How about we add '@' or another binary selector so we can avoid the parentheses?

Peter


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk ui icons vs iconNamed: vs @

Peter Uhnak
On Mon, May 30, 2016 at 02:47:03PM +0000, Henrik Nergaard wrote:
> What about
>
> Symbol >>#asIcon
>
>    ^ Smalltalk ui icons iconNamed: self
>
> Then one can do: "#add asIcon" ?

+1

>
> Best regards,
> Henrik
>
>
> -----Original Message-----
> From: Pharo-dev [mailto:[hidden email]] On Behalf Of Peter Uhnak
> Sent: Monday, May 30, 2016 4:34 PM
> To: Pharo Development List <[hidden email]>
> Subject: [Pharo-dev] Smalltalk ui icons vs iconNamed: vs @
>
> Hi,
>
> My understanding is that now instead of
>
> Smalltalk ui icons smallConfigurationIcon
>
> I should do
>
> Smalltalk ui iconNamed: #smallConfigurationIcon
>
> This is however really unpractical, because it changes the operator priority, so I have to wrap it in parentheses every single time.
>
> Button new
> icon: (... iconNamed: ...)
>
> How about we add '@' or another binary selector so we can avoid the parentheses?
>
> Peter
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk ui icons vs iconNamed: vs @

stepharo
In reply to this post by Henrik Nergaard
Yes we were thinking about it too.

Stef


Le 30/5/16 à 15:47, Henrik Nergaard a écrit :

> What about
>
> Symbol >>#asIcon
>
>     ^ Smalltalk ui icons iconNamed: self
>
> Then one can do: "#add asIcon" ?
>
> Best regards,
> Henrik
>
>
> -----Original Message-----
> From: Pharo-dev [mailto:[hidden email]] On Behalf Of Peter Uhnak
> Sent: Monday, May 30, 2016 4:34 PM
> To: Pharo Development List <[hidden email]>
> Subject: [Pharo-dev] Smalltalk ui icons vs iconNamed: vs @
>
> Hi,
>
> My understanding is that now instead of
>
> Smalltalk ui icons smallConfigurationIcon
>
> I should do
>
> Smalltalk ui iconNamed: #smallConfigurationIcon
>
> This is however really unpractical, because it changes the operator priority, so I have to wrap it in parentheses every single time.
>
> Button new
> icon: (... iconNamed: ...)
>
> How about we add '@' or another binary selector so we can avoid the parentheses?
>
> Peter
>
>
>