Unintended consequences; part zillion of a gazillion

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

Unintended consequences; part zillion of a gazillion

timrowledge
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.

Unfortunately, ‘no’ is also the code for the Norwegian language setting, so a menu of language codes has this mysterious big ‘X” icon next to that entry. So far as I can see right now there isn’t any way to actually access the menu building so as to tell it not to be so ‘helpful. I’m sure it wouldn’t be too hard but I just don’t have time to worry about that for now.

A lesson in the need for careful thinking, brought to you by the letters ’n’ and ‘o’.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
'Profanity: the universal programming language'





Reply | Threaded
Open this post in threaded view
|

re: Unintended consequences; part zillion of a gazillion

ccrraaiigg

> Unfortunately, ‘no’ is also the code for the Norwegian language
> setting, so a menu of language codes has this mysterious big ‘X” icon
> next to that entry.

     No (r) way!


-C

--
Craig Latta
www.netjam.org/resume
+31   6 2757 7177 (SMS ok)
+ 1 415 287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

re: Unintended consequences; part zillion of a gazillion

timrowledge

On 18-03-2014, at 2:04 PM, Craig Latta <[hidden email]> wrote:

>
>> Unfortunately, ‘no’ is also the code for the Norwegian language
>> setting, so a menu of language codes has this mysterious big ‘X” icon
>> next to that entry.
>
>     No (r) way!

Please accept this shiny new Internets.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Meets quality standards: It compiles without errors.



Reply | Threaded
Open this post in threaded view
|

Re: Unintended consequences; part zillion of a gazillion

timrowledge
In reply to this post by timrowledge

On 18-03-2014, at 12:53 PM, tim Rowledge <[hidden email]> 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; [hidden email]; http://www.rowledge.org/tim
CChheecckk yyoouurr dduupplleexx sswwiittcchh..