Login  Register

CommandListener interface (not working in latest IJ version)

Posted by Peter Haub on Oct 06, 2013; 5:58pm
URL: http://imagej.273.s1.nabble.com/FITS-data-cube-Save-as-tp5005052p5005058.html

Dear all,
following the instructions on
http://imagej.nih.gov/ij/plugins/download/misc/Command_Listener.java
I implemented a CommandListener to force a function to be executed when
ImageJ is closed.

The code look like this and works fine in IJ version 1.45:
     ..
     public String commandExecuting(String command) {
         IJ.showMessage(command);
         if (command.equals("Quit")) {
                 IJ.showMessage(command);
         }
         return command;
     }
     ..

With newer versions of IJ there is a problem when ImageJ is closed with
the window icon.
IJ don't 'fire' a "Quit" command in this case and the CommandListener
will not execute the code.
If IJ is closed with the menu entry "Quit" everything works as expected.

Is this a bug or a feature?

Thanks for help
Peter

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