Re: Non-modal dialog in window list?
Posted by
Michael Schmid on
Jun 08, 2009; 7:32am
URL: http://imagej.273.s1.nabble.com/Non-modal-dialog-in-window-list-tp3692239p3692241.html
Hi Bill,
oops, sorry, a correction is necessary (it took me a while to notice).
Unless you need other code in the close method, you don't need the
public void close() method.
ij.plugin.frame.PlugInFrame has a close method that removes the frame
from the Window Manager.
Michael
________________________________________________________________
On 2 Jun 2009, at 11:22, Michael Schmid wrote:
> Hi Bill,
>
> when creating the frame, you need code like this in a PlugInFrame:
>
> this.setTitle(myTitle);
> WindowManager.addWindow(this);
>
> And when closing
>
> /** Overrides the superclass close method */
> public void close () {
> WindowManager.removeWindow(this);
> super.close();
> }
>
> If you don't have a PlugInFrame, I suspect that it would work the
> same way, with 'this' replaced by the reference to the frame. You
> will have to detect the 'Frame closed' event to remove your frame
> from the list - having a PlugInFrame is a simple solution for this
> (see the code above).
>
> Michael
> ________________________________________________________________
>
> On 1 Jun 2009, at 16:03, Bill Mohler wrote:
>
>> I just created a new non-modal dialog which implements PlugIn and
>> properly installs itself in the Plugins menu at start up. When the
>> Dialog is open, however, it does not appear in the Window list of
>> ImageJ although the process is clearly running within ImageJ.
>>
>> Q: Does my plugin class need to extend PlugInFrame in order to
>> appear in the Window menu when open?
>>
>> Thank,
>> Bill
>