|
Hi,
I'm using the stock generic dialog example (found in the GenericDialog class Javadoc) that I tried to adapt as a javascript :
importPackage (Packages.java.lang);
gd = new GenericDialog("New Image");
gd.addStringField("Title: ", "example");
gd.addNumericField("Width: ", 512, 0);
gd.addNumericField("Height: ", 512, 0);
gd.showDialog();
if (gd.wasCanceled()) return;
title = gd.getNextString();
imwidth = gd.getNextNumber();
imheight = gd.getNextNumber();
IJ.newImage(title, "8-bit", imwidth, imheight, 1);
However I get an error with the gd.wasCanceled() method with an error saying:
org.mozilla.javascript.EvaluatorException: la valeur renvoyée est incorrecte
which translates to something like "incorrect returned value".
Any clue on what happens here? I'm running IJ 1.46d in Fiji.
Christophe
|