Floating window through Plugins

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

Floating window through Plugins

Dimitri Vanhecke-2
Hi everybody,

I produced a plugin that reads a file, puts the metadata in a dialogbox
and opens the image (I want to have specific metadata on my screen all
the time, and not "hidden" in the Image>Info menu).
Unfortunately, I did not find a way to make the dialog "floating", i.e.,
I have to close it in order to access other windows in ImageJ (including
my image). How can I make a GenericDialog floating?


Thanks for the help,

Dimitri Vanhecke
Reply | Threaded
Open this post in threaded view
|

Re: Floating window through Plugins

Gabriel Landini
On Thursday 20 August 2009, Dimitri Vanhecke wrote:
> I produced a plugin that reads a file, puts the metadata in a dialogbox
> and opens the image (I want to have specific metadata on my screen all
> the time, and not "hidden" in the Image>Info menu).
> Unfortunately, I did not find a way to make the dialog "floating", i.e.,
> I have to close it in order to access other windows in ImageJ (including
> my image). How can I make a GenericDialog floating?

You can't. These are modal dialogs (so they stop what you are doing).

Have a look at the source code of other plugins that have non-modal dialogs
and work from there.

However, wouldn't it be easier to just print the metadata to the log window?
Or print this info into a new text window?

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: Floating window through Plugins

dscho
In reply to this post by Dimitri Vanhecke-2
Hi,

On Thu, 20 Aug 2009, Dimitri Vanhecke wrote:

> I produced a plugin that reads a file, puts the metadata in a dialogbox and
> opens the image (I want to have specific metadata on my screen all the time,
> and not "hidden" in the Image>Info menu).
> Unfortunately, I did not find a way to make the dialog "floating", i.e., I
> have to close it in order to access other windows in ImageJ (including my
> image). How can I make a GenericDialog floating?

We have code in Fiji to do that:

http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=blob;f=src-plugins/Non_Modal_Test/NonblockingGenericDialog.java;h=57d9b8a87992016798bd7326515d88586df2f906;hb=6b136d1eb6e1cbd7fa79943d77f0254145c7e230

See an example how to use it:

http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=blob;f=src-plugins/Non_Modal_Test/Test_Dialog.java;h=287da045fb2e6a38eb6e1dc3701f619d7363f36f;hb=6b136d1eb6e1cbd7fa79943d77f0254145c7e230

As long as you abide by the GPLv2, you are free to use this code.

Ciao,
Dscho