Login  Register

Re: get micron sign into a dialog menu

Posted by Wayne Rasband on Apr 14, 2008; 2:31pm
URL: http://imagej.273.s1.nabble.com/get-micron-sign-into-a-dialog-menu-tp3696565p3696566.html

On Apr 14, 2008, at 8:52 AM, Michael Doube wrote:

> Hi all
>
> Just a fiddly little question:  I want to get a menu into a macro
> dialog that lists units, mm, µm, nm, px.  To get the µm, I have this
> code:
>
> var microns = fromCharCode(181,109);
> var units = newArray("mm", microns, "nm", "px");
>
> Then put into a dialog menu like this:
>
> Dialog.addChoice("Units: ", units);
>
> but instead of µm I get NaN in my menu.
>
> Any suggestions?

This problem is due to a bug in the newArray() macro function. This bug
is fixed in v1.40e, or you can work around it using

   microns = fromCharCode(181,109);
   units = newArray("mm", microns, "nm", "px");
   units[1] = microns;

-wayne