Posted by
Ryota Homma on
Mar 12, 2014; 7:39pm
URL: http://imagej.273.s1.nabble.com/Re-Removing-NonBlockingGenericDialogs-from-the-Window-menu-tp5006887.html
Dear Wayne, Johannes, and all list members,
I found the above indeed occurred with the latest daily build I tried (v1.48t2).
When a plugin that would open a non-blocking generic dialog is called from
a macro (in which the dialog is automatically OKed), the title of dialog is not
removed from the Window menu.
Best,
Ryota
>
> While looking at the larger context, I also could not help but notice that
> the dialog is added to the Window menu long before the dialog is shown.
> And indeed, it is added to the Window menu even if the dialog is not shown
> at all (for which there are quite a few use cases -- I trust your
> imagination to come up with even more than I could think of).
>
> A better practice would be to implement something like this (sorry, I have
> no time to test this, besides, you made clear that you like to implement
> such changes yourself and ignore pull requests, therefore I will not
> burden you with one):
>
> @Override
> public void setVisible(boolean visible) {
> if (!visible) {
> WindowManager.removeWindow(this);
> }
> super.setVisible(visible);
> if (visible) {
> WindowManager.addWindow(this);
> }
> }
>
> Regards,
> Johannes
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html