Results table questions

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

Results table questions

Bob Loushin
I have several questions about the Results table.

1)  Recently someone asked if there was a way to close the results table from a plugin.  I've been looking for a way to do this, too.  The closest I've come is the following:

Frame res = WindowManager.getFrame("Results");
if (res != null) res.dispose();

This kills the result table.  Unfortunately, it seems to be too effective...the next time I do an IJ.write (for instance, if the plugin ends and then is restarted), the results table does not come back.  So if anyone knows of a way to close the Results table but allow it to be re-opened by the usual methods, please let us know!

2)  According to the API documentation for v1.43r, IJ.write(String) is deprecated in favor of IJ.log(String).  Does anybody know why?  I don't care if the window my user gets the results in says "Results" or "Log" at the top, but as far as I know, the log file lacks the equivalent of IJ.setColumnHeadings, IJ.isResultsWindow, etc.  Is there a reason for the change-over, and are there plans to beef up the support for the log window?

Thanks,
Bob
Reply | Threaded
Open this post in threaded view
|

Re: Results table questions

Gabriel Landini
On Monday 15 Mar 2010  15:33:41 you wrote:
> 2)  According to the API documentation for v1.43r, IJ.write(String) is
> deprecated in favor of IJ.log(String).  Does anybody know why?  I don't
> care if the window my user gets the results in says "Results" or "Log" at
> the top, but as far as I know, the log file lacks the equivalent of
> IJ.setColumnHeadings, IJ.isResultsWindow, etc.

It is not just a matter or window title, so maybe one should care about this.
You can retrieve the data back from the results table (from another plugin or
a macro) if it was put there in the right way via rt.addValue() or
rt.addLabel() instead of IJ.write().

If you just IJ.write to it, you'll see the data in the window, but you will
not be able to retrieve it programatically (well maybe you can, but not easily
column/row-wise). I guess (but might be wrong) this is the reason for
suggesting to use "log" instead of "write".

Cheers,
G.