Bug or feature - This is the question

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

Bug or feature - This is the question

CARL Philippe (LBP)
Dear all,
The following small macro code will throw in an error
                WinOp = getList("window.titles");
// WinOp = Array.deleteValue(WinOp, "Command Finder");
                for(i = 0; i < WinOp.length; i++)
                {
                        selectWindow(WinOp[i]);
                        run("Close");
                }
unless I uncomment the second line of the code.
This means that I can't apply a "run("Close");" on a "Command Finder" window.
Thus is this restriction done in purpose or rather a bug?
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 42 89

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Bug or feature - This is the question

Wayne Rasband-2
> Dear all,
> The following small macro code will throw in an error
>                WinOp = getList("window.titles");
> // WinOp = Array.deleteValue(WinOp, "Command Finder");
>                for(i = 0; i < WinOp.length; i++)
>                {
>                        selectWindow(WinOp[i]);
>                        run("Close");
>                }
> unless I uncomment the second line of the code.
> This means that I can't apply a "run("Close");" on a "Command Finder" window.
> Thus is this restriction done in purpose or rather a bug?
> My best regards,
> Philippe

The File>Close command, and the close("Command Finder") macro function, do not work with the "Command Finder" window because it is a JFrame, not an ImageWindow, PlugInFrame, PlugInDialog or TextWindow. I do not see an easy fix for this problem.

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Bug or feature - This is the question

CARL Philippe (LBP)
Dear Wayne,
Thanks a lot for your answer and don't bother I'm solving the issue by just uncommenting the line with the Array.deleteValue.
Take care,
Philippe

----- Mail original -----
De: "Wayne Rasband" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Mercredi 31 Mars 2021 19:05:33
Objet: Re: Bug or feature - This is the question

> Dear all,
> The following small macro code will throw in an error
>                WinOp = getList("window.titles");
> // WinOp = Array.deleteValue(WinOp, "Command Finder");
>                for(i = 0; i < WinOp.length; i++)
>                {
>                        selectWindow(WinOp[i]);
>                        run("Close");
>                }
> unless I uncomment the second line of the code.
> This means that I can't apply a "run("Close");" on a "Command Finder" window.
> Thus is this restriction done in purpose or rather a bug?
> My best regards,
> Philippe

The File>Close command, and the close("Command Finder") macro function, do not work with the "Command Finder" window because it is a JFrame, not an ImageWindow, PlugInFrame, PlugInDialog or TextWindow. I do not see an easy fix for this problem.

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html