[squeak-dev] Unintended consequences; part zillion of a gazillion

tim Rowledge tim at rowledge.org
Thu Mar 20 21:36:09 UTC 2014


On 18-03-2014, at 12:53 PM, tim Rowledge <tim at rowledge.org> wrote:

> I just stumbled over a fairly amusing case of unintended consequences.
> 
> In MenuMorph we have the ability to add icons next to the text labels of any menu item. To be ‘helpful’ somebody decided to allow parsing of the texts sent to MenuItemMorphs to see if ..
> (#('<on>' '<off>' '<yes>' '<no>') includes: marker) 
> and if so, attach a suitable icon to the entry.

To make this even more amusing, the code I was referring to is not the actual culprit in this case; I failed to properly note the <no> being wrapped in <>. It’s actually a strange little side thingy that decorates menu items if the preference for ‘menus with icons’ is true. The MenuIcons class has a longish list of menu item strings it will provide an icon for; when MenuMorph>popUpAt:forHand:in:allowKeyboard: runs it uses MenuIcons decorateMenu: self. 


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
CChheecckk yyoouurr dduupplleexx sswwiittcchh..




More information about the Squeak-dev mailing list