How to put a picture as selected

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to put a picture as selected

CARL Philippe (LBP)
Dear all,
Please consider the following plugin:
        run("Blobs (25K)");
        imageName = getTitle();
        print(getInfo("window.title"));
        Dialog.createNonBlocking("New Image");
        Dialog.addString("Title:","Untitled");
        Dialog.show();
        print(getInfo("window.title"));
        selectWindow(imageName);
        print(getInfo("window.title"));
Knowing that the dialog is nonBlocking, it is still not possible to get the "Blobs" picture as selected (or in focus).
This issue came from a plugin where I have stack which I would like to put as selected in order to the user to be able to browse through the stack without having the user to manually put the stack picture in focus.
Thus is what I'm trying to do possible and if yes, how?
I thank you very much in advance for your lighting on this.
My best regards,
Philippe


Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How to put a picture as selected

Michael Schmid-3
Hi Philippe,

if you create a non-blocking dialog in a macro, it means that the user
can do everything else while the dialog is open, but the macro does not
proceed until the user presses "ok".

So the non-blocking dialog is a bit like "waitForUser(message)", just
that the "waitForUser" dialog has no possibilities for input and no
cancel button.

With a macro, I see no way to select the image after creating the
dialog. But I think this is not desirable anyhow, because the image
might hide the dialog!
It often makes sense to select a certain image *before* showing the
dialog, so that the user has the image he/she needs for whatever should
be done in the dialog.


Michael
________________________________________________________________
On 02.12.19 14:19, CARL Philippe (LBP) wrote:

> Dear all,
> Please consider the following plugin:
> run("Blobs (25K)");
> imageName = getTitle();
> print(getInfo("window.title"));
> Dialog.createNonBlocking("New Image");
> Dialog.addString("Title:","Untitled");
> Dialog.show();
> print(getInfo("window.title"));
> selectWindow(imageName);
> print(getInfo("window.title"));
> Knowing that the dialog is nonBlocking, it is still not possible to get the "Blobs" picture as selected (or in focus).
> This issue came from a plugin where I have stack which I would like to put as selected in order to the user to be able to browse through the stack without having the user to manually put the stack picture in focus.
> Thus is what I'm trying to do possible and if yes, how?
> I thank you very much in advance for your lighting on this.
> My best regards,
> Philippe
>
>
> Philippe CARL
> Laboratoire de Bioimagerie et Pathologies
> UMR 7021 CNRS - Université de Strasbourg
> Faculté de Pharmacie
> 74 route du Rhin
> 67401 ILLKIRCH
> Tel : +33(0)3 68 85 41 84
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How to put a picture as selected

CARL Philippe (LBP)
Hi Michael,
I agree completely with your comments on the fact that a non-blocking dialog is a waitForUser like dialog.
Nevertheless, I would rather like to come back to your following comment:
> With a macro, I see no way to select the image after creating the dialog.
Does it mean that there is a way to select a picture using a java code within a plugin?
I only wrote a macro for illustration but I really want to use such a code within a plugin, not a macro.
My best regards,
Philippe

----- Mail original -----
De: "Michael Schmid" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Lundi 2 Décembre 2019 19:26:19
Objet: Re: How to put a picture as selected

Hi Philippe,

if you create a non-blocking dialog in a macro, it means that the user
can do everything else while the dialog is open, but the macro does not
proceed until the user presses "ok".

So the non-blocking dialog is a bit like "waitForUser(message)", just
that the "waitForUser" dialog has no possibilities for input and no
cancel button.

With a macro, I see no way to select the image after creating the
dialog. But I think this is not desirable anyhow, because the image
might hide the dialog!
It often makes sense to select a certain image *before* showing the
dialog, so that the user has the image he/she needs for whatever should
be done in the dialog.


Michael
________________________________________________________________
On 02.12.19 14:19, CARL Philippe (LBP) wrote:

> Dear all,
> Please consider the following plugin:
> run("Blobs (25K)");
> imageName = getTitle();
> print(getInfo("window.title"));
> Dialog.createNonBlocking("New Image");
> Dialog.addString("Title:","Untitled");
> Dialog.show();
> print(getInfo("window.title"));
> selectWindow(imageName);
> print(getInfo("window.title"));
> Knowing that the dialog is nonBlocking, it is still not possible to get the "Blobs" picture as selected (or in focus).
> This issue came from a plugin where I have stack which I would like to put as selected in order to the user to be able to browse through the stack without having the user to manually put the stack picture in focus.
> Thus is what I'm trying to do possible and if yes, how?
> I thank you very much in advance for your lighting on this.
> My best regards,
> Philippe
>
>
> Philippe CARL
> Laboratoire de Bioimagerie et Pathologies
> UMR 7021 CNRS - Université de Strasbourg
> Faculté de Pharmacie
> 74 route du Rhin
> 67401 ILLKIRCH
> Tel : +33(0)3 68 85 41 84
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How to put a picture as selected

Michael Schmid-3
Hi Philippe,

if you need to put something forward immediately after a
NonBlockingGenericDialog is shown, one option is to use a second thread.
That thread could wait in a loop until the dialog is in the foreground,
with repeated calls to WindowManager.getFrontWindow(), then put the
other window to the front and terminate.

Have a small delay in the loop, e.g. IJ.wait(10), to avoid unnecessary
CPU load.

It is not 100% bulletproof. With bad luck one could click on another
window and bring it to the front a microsecond after the dialog gets
shown, then the other thread never detects the dialog coming to the
front and runs forever. On could handle this with a timeout.


Michael
________________________________________________________________
On 02.12.19 22:03, CARL Philippe (LBP) wrote:

> Hi Michael,
> I agree completely with your comments on the fact that a non-blocking dialog is a waitForUser like dialog.
> Nevertheless, I would rather like to come back to your following comment:
>> With a macro, I see no way to select the image after creating the dialog.
> Does it mean that there is a way to select a picture using a java code within a plugin?
> I only wrote a macro for illustration but I really want to use such a code within a plugin, not a macro.
> My best regards,
> Philippe
>
> ----- Mail original -----
> De: "Michael Schmid" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Lundi 2 Décembre 2019 19:26:19
> Objet: Re: How to put a picture as selected
>
> Hi Philippe,
>
> if you create a non-blocking dialog in a macro, it means that the user
> can do everything else while the dialog is open, but the macro does not
> proceed until the user presses "ok".
>
> So the non-blocking dialog is a bit like "waitForUser(message)", just
> that the "waitForUser" dialog has no possibilities for input and no
> cancel button.
>
> With a macro, I see no way to select the image after creating the
> dialog. But I think this is not desirable anyhow, because the image
> might hide the dialog!
> It often makes sense to select a certain image *before* showing the
> dialog, so that the user has the image he/she needs for whatever should
> be done in the dialog.
>
>
> Michael
> ________________________________________________________________
> On 02.12.19 14:19, CARL Philippe (LBP) wrote:
>> Dear all,
>> Please consider the following plugin:
>> run("Blobs (25K)");
>> imageName = getTitle();
>> print(getInfo("window.title"));
>> Dialog.createNonBlocking("New Image");
>> Dialog.addString("Title:","Untitled");
>> Dialog.show();
>> print(getInfo("window.title"));
>> selectWindow(imageName);
>> print(getInfo("window.title"));
>> Knowing that the dialog is nonBlocking, it is still not possible to get the "Blobs" picture as selected (or in focus).
>> This issue came from a plugin where I have stack which I would like to put as selected in order to the user to be able to browse through the stack without having the user to manually put the stack picture in focus.
>> Thus is what I'm trying to do possible and if yes, how?
>> I thank you very much in advance for your lighting on this.
>> My best regards,
>> Philippe
>>
>>
>> Philippe CARL
>> Laboratoire de Bioimagerie et Pathologies
>> UMR 7021 CNRS - Université de Strasbourg
>> Faculté de Pharmacie
>> 74 route du Rhin
>> 67401 ILLKIRCH
>> Tel : +33(0)3 68 85 41 84
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How to put a picture as selected

CARL Philippe (LBP)
Dear Michael,
I may very probably only be missing a little something, but I'm not fully able to follow your recommandations.
So within my main code, I wrote:
        Thread bgThread = new Thread(this, "Window in front");
        bgThread.setPriority(Math.max(bgThread.getPriority() - 3, Thread.MIN_PRIORITY));
        bgThread.start();

        NonBlockingGenericDialog nbgd = new NonBlockingGenericDialog("Action Required");
        nbgd.addMessage("Message");
        nbgd.addCheckbox("Choice", choice);
        synchronized(this)
        {
                nbgd.showDialog();
        }
        if (nbgd.wasCanceled())
        {
                return;
        }
        bgThread.interrupt();
        bgThread = null;
together with the following void:
        public void run()
        {
                while (WindowManager.getActiveWindow() != stackWindow)
                {
                        IJ.wait(10);
                        WindowManager.setWindow(stackWindow);
                }
        }
So if I have an IJ.log where ever within the run() void (i.e. within the while loop or before) the code is working as expected.
But stackWindow isn't anymore put in front if I don't have any IJ.log within the run() void.
Thus what is my mistake?
I thank you very much in advance for your (as always!) very bright lighting.
Have a nice week-end,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Michael Schmid" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Mardi 3 Décembre 2019 21:09:12
Objet: Re: How to put a picture as selected

Hi Philippe,

if you need to put something forward immediately after a
NonBlockingGenericDialog is shown, one option is to use a second thread.
That thread could wait in a loop until the dialog is in the foreground,
with repeated calls to WindowManager.getFrontWindow(), then put the
other window to the front and terminate.

Have a small delay in the loop, e.g. IJ.wait(10), to avoid unnecessary
CPU load.

It is not 100% bulletproof. With bad luck one could click on another
window and bring it to the front a microsecond after the dialog gets
shown, then the other thread never detects the dialog coming to the
front and runs forever. On could handle this with a timeout.


Michael
________________________________________________________________
On 02.12.19 22:03, CARL Philippe (LBP) wrote:

> Hi Michael,
> I agree completely with your comments on the fact that a non-blocking dialog is a waitForUser like dialog.
> Nevertheless, I would rather like to come back to your following comment:
>> With a macro, I see no way to select the image after creating the dialog.
> Does it mean that there is a way to select a picture using a java code within a plugin?
> I only wrote a macro for illustration but I really want to use such a code within a plugin, not a macro.
> My best regards,
> Philippe
>
> ----- Mail original -----
> De: "Michael Schmid" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Lundi 2 Décembre 2019 19:26:19
> Objet: Re: How to put a picture as selected
>
> Hi Philippe,
>
> if you create a non-blocking dialog in a macro, it means that the user
> can do everything else while the dialog is open, but the macro does not
> proceed until the user presses "ok".
>
> So the non-blocking dialog is a bit like "waitForUser(message)", just
> that the "waitForUser" dialog has no possibilities for input and no
> cancel button.
>
> With a macro, I see no way to select the image after creating the
> dialog. But I think this is not desirable anyhow, because the image
> might hide the dialog!
> It often makes sense to select a certain image *before* showing the
> dialog, so that the user has the image he/she needs for whatever should
> be done in the dialog.
>
>
> Michael
> ________________________________________________________________
> On 02.12.19 14:19, CARL Philippe (LBP) wrote:
>> Dear all,
>> Please consider the following plugin:
>> run("Blobs (25K)");
>> imageName = getTitle();
>> print(getInfo("window.title"));
>> Dialog.createNonBlocking("New Image");
>> Dialog.addString("Title:","Untitled");
>> Dialog.show();
>> print(getInfo("window.title"));
>> selectWindow(imageName);
>> print(getInfo("window.title"));
>> Knowing that the dialog is nonBlocking, it is still not possible to get the "Blobs" picture as selected (or in focus).
>> This issue came from a plugin where I have stack which I would like to put as selected in order to the user to be able to browse through the stack without having the user to manually put the stack picture in focus.
>> Thus is what I'm trying to do possible and if yes, how?
>> I thank you very much in advance for your lighting on this.
>> My best regards,
>> Philippe
>>
>>
>> Philippe CARL
>> Laboratoire de Bioimagerie et Pathologies
>> UMR 7021 CNRS - Université de Strasbourg
>> Faculté de Pharmacie
>> 74 route du Rhin
>> 67401 ILLKIRCH
>> Tel : +33(0)3 68 85 41 84
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How to put a picture as selected

Michael Schmid-3
Hi Philippe,

could it be that you start with stackWindow being the front window? Then
the background thread will terminate immediately.


Michael
________________________________________________________________
On 06.12.19 16:28, CARL Philippe (LBP) wrote:

> Dear Michael,
> I may very probably only be missing a little something, but I'm not fully able to follow your recommandations.
> So within my main code, I wrote:
> Thread bgThread = new Thread(this, "Window in front");
> bgThread.setPriority(Math.max(bgThread.getPriority() - 3, Thread.MIN_PRIORITY));
> bgThread.start();
>
> NonBlockingGenericDialog nbgd = new NonBlockingGenericDialog("Action Required");
> nbgd.addMessage("Message");
> nbgd.addCheckbox("Choice", choice);
> synchronized(this)
> {
> nbgd.showDialog();
> }
> if (nbgd.wasCanceled())
> {
> return;
> }
> bgThread.interrupt();
> bgThread = null;
> together with the following void:
> public void run()
> {
> while (WindowManager.getActiveWindow() != stackWindow)
> {
> IJ.wait(10);
> WindowManager.setWindow(stackWindow);
> }
> }
> So if I have an IJ.log where ever within the run() void (i.e. within the while loop or before) the code is working as expected.
> But stackWindow isn't anymore put in front if I don't have any IJ.log within the run() void.
> Thus what is my mistake?
> I thank you very much in advance for your (as always!) very bright lighting.
> Have a nice week-end,
> Philippe
>
> Philippe CARL
> Laboratoire de Bioimagerie et Pathologies
> UMR 7021 CNRS - Université de Strasbourg
> Faculté de Pharmacie
> 74 route du Rhin
> 67401 ILLKIRCH
> Tel : +33(0)3 68 85 41 84
>
> ----- Mail original -----
> De: "Michael Schmid" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Mardi 3 Décembre 2019 21:09:12
> Objet: Re: How to put a picture as selected
>
> Hi Philippe,
>
> if you need to put something forward immediately after a
> NonBlockingGenericDialog is shown, one option is to use a second thread.
> That thread could wait in a loop until the dialog is in the foreground,
> with repeated calls to WindowManager.getFrontWindow(), then put the
> other window to the front and terminate.
>
> Have a small delay in the loop, e.g. IJ.wait(10), to avoid unnecessary
> CPU load.
>
> It is not 100% bulletproof. With bad luck one could click on another
> window and bring it to the front a microsecond after the dialog gets
> shown, then the other thread never detects the dialog coming to the
> front and runs forever. On could handle this with a timeout.
>
>
> Michael
> ________________________________________________________________
> On 02.12.19 22:03, CARL Philippe (LBP) wrote:
>> Hi Michael,
>> I agree completely with your comments on the fact that a non-blocking dialog is a waitForUser like dialog.
>> Nevertheless, I would rather like to come back to your following comment:
>>> With a macro, I see no way to select the image after creating the dialog.
>> Does it mean that there is a way to select a picture using a java code within a plugin?
>> I only wrote a macro for illustration but I really want to use such a code within a plugin, not a macro.
>> My best regards,
>> Philippe
>>
>> ----- Mail original -----
>> De: "Michael Schmid" <[hidden email]>
>> À: "imagej" <[hidden email]>
>> Envoyé: Lundi 2 Décembre 2019 19:26:19
>> Objet: Re: How to put a picture as selected
>>
>> Hi Philippe,
>>
>> if you create a non-blocking dialog in a macro, it means that the user
>> can do everything else while the dialog is open, but the macro does not
>> proceed until the user presses "ok".
>>
>> So the non-blocking dialog is a bit like "waitForUser(message)", just
>> that the "waitForUser" dialog has no possibilities for input and no
>> cancel button.
>>
>> With a macro, I see no way to select the image after creating the
>> dialog. But I think this is not desirable anyhow, because the image
>> might hide the dialog!
>> It often makes sense to select a certain image *before* showing the
>> dialog, so that the user has the image he/she needs for whatever should
>> be done in the dialog.
>>
>>
>> Michael
>> ________________________________________________________________
>> On 02.12.19 14:19, CARL Philippe (LBP) wrote:
>>> Dear all,
>>> Please consider the following plugin:
>>> run("Blobs (25K)");
>>> imageName = getTitle();
>>> print(getInfo("window.title"));
>>> Dialog.createNonBlocking("New Image");
>>> Dialog.addString("Title:","Untitled");
>>> Dialog.show();
>>> print(getInfo("window.title"));
>>> selectWindow(imageName);
>>> print(getInfo("window.title"));
>>> Knowing that the dialog is nonBlocking, it is still not possible to get the "Blobs" picture as selected (or in focus).
>>> This issue came from a plugin where I have stack which I would like to put as selected in order to the user to be able to browse through the stack without having the user to manually put the stack picture in focus.
>>> Thus is what I'm trying to do possible and if yes, how?
>>> I thank you very much in advance for your lighting on this.
>>> My best regards,
>>> Philippe
>>>
>>>
>>> Philippe CARL
>>> Laboratoire de Bioimagerie et Pathologies
>>> UMR 7021 CNRS - Université de Strasbourg
>>> Faculté de Pharmacie
>>> 74 route du Rhin
>>> 67401 ILLKIRCH
>>> Tel : +33(0)3 68 85 41 84
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How to put a picture as selected

CARL Philippe (LBP)
Hi again Michael,
I have only 3 windows open within the plugin:
- stackWindow
- roiManager
- the created NonBlockingGenericDialog
Thus your idea may indeed be right.
Nevertheless by adding a:
        WindowManager.setWindow(RoiManager.getInstance());
prior to the NonBlockingGenericDialog nbgd definition or even just before the
        synchronized(this)
        {
                nbgd.showDialog();
        }
it isn't working as well.
My best regards,
Philippe

----- Mail original -----
De: "Michael Schmid" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Vendredi 6 Décembre 2019 17:30:21
Objet: Re: How to put a picture as selected

Hi Philippe,

could it be that you start with stackWindow being the front window? Then
the background thread will terminate immediately.


Michael
________________________________________________________________
On 06.12.19 16:28, CARL Philippe (LBP) wrote:

> Dear Michael,
> I may very probably only be missing a little something, but I'm not fully able to follow your recommandations.
> So within my main code, I wrote:
> Thread bgThread = new Thread(this, "Window in front");
> bgThread.setPriority(Math.max(bgThread.getPriority() - 3, Thread.MIN_PRIORITY));
> bgThread.start();
>
> NonBlockingGenericDialog nbgd = new NonBlockingGenericDialog("Action Required");
> nbgd.addMessage("Message");
> nbgd.addCheckbox("Choice", choice);
> synchronized(this)
> {
> nbgd.showDialog();
> }
> if (nbgd.wasCanceled())
> {
> return;
> }
> bgThread.interrupt();
> bgThread = null;
> together with the following void:
> public void run()
> {
> while (WindowManager.getActiveWindow() != stackWindow)
> {
> IJ.wait(10);
> WindowManager.setWindow(stackWindow);
> }
> }
> So if I have an IJ.log where ever within the run() void (i.e. within the while loop or before) the code is working as expected.
> But stackWindow isn't anymore put in front if I don't have any IJ.log within the run() void.
> Thus what is my mistake?
> I thank you very much in advance for your (as always!) very bright lighting.
> Have a nice week-end,
> Philippe
>
> Philippe CARL
> Laboratoire de Bioimagerie et Pathologies
> UMR 7021 CNRS - Université de Strasbourg
> Faculté de Pharmacie
> 74 route du Rhin
> 67401 ILLKIRCH
> Tel : +33(0)3 68 85 41 84
>
> ----- Mail original -----
> De: "Michael Schmid" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Mardi 3 Décembre 2019 21:09:12
> Objet: Re: How to put a picture as selected
>
> Hi Philippe,
>
> if you need to put something forward immediately after a
> NonBlockingGenericDialog is shown, one option is to use a second thread.
> That thread could wait in a loop until the dialog is in the foreground,
> with repeated calls to WindowManager.getFrontWindow(), then put the
> other window to the front and terminate.
>
> Have a small delay in the loop, e.g. IJ.wait(10), to avoid unnecessary
> CPU load.
>
> It is not 100% bulletproof. With bad luck one could click on another
> window and bring it to the front a microsecond after the dialog gets
> shown, then the other thread never detects the dialog coming to the
> front and runs forever. On could handle this with a timeout.
>
>
> Michael
> ________________________________________________________________
> On 02.12.19 22:03, CARL Philippe (LBP) wrote:
>> Hi Michael,
>> I agree completely with your comments on the fact that a non-blocking dialog is a waitForUser like dialog.
>> Nevertheless, I would rather like to come back to your following comment:
>>> With a macro, I see no way to select the image after creating the dialog.
>> Does it mean that there is a way to select a picture using a java code within a plugin?
>> I only wrote a macro for illustration but I really want to use such a code within a plugin, not a macro.
>> My best regards,
>> Philippe
>>
>> ----- Mail original -----
>> De: "Michael Schmid" <[hidden email]>
>> À: "imagej" <[hidden email]>
>> Envoyé: Lundi 2 Décembre 2019 19:26:19
>> Objet: Re: How to put a picture as selected
>>
>> Hi Philippe,
>>
>> if you create a non-blocking dialog in a macro, it means that the user
>> can do everything else while the dialog is open, but the macro does not
>> proceed until the user presses "ok".
>>
>> So the non-blocking dialog is a bit like "waitForUser(message)", just
>> that the "waitForUser" dialog has no possibilities for input and no
>> cancel button.
>>
>> With a macro, I see no way to select the image after creating the
>> dialog. But I think this is not desirable anyhow, because the image
>> might hide the dialog!
>> It often makes sense to select a certain image *before* showing the
>> dialog, so that the user has the image he/she needs for whatever should
>> be done in the dialog.
>>
>>
>> Michael
>> ________________________________________________________________
>> On 02.12.19 14:19, CARL Philippe (LBP) wrote:
>>> Dear all,
>>> Please consider the following plugin:
>>> run("Blobs (25K)");
>>> imageName = getTitle();
>>> print(getInfo("window.title"));
>>> Dialog.createNonBlocking("New Image");
>>> Dialog.addString("Title:","Untitled");
>>> Dialog.show();
>>> print(getInfo("window.title"));
>>> selectWindow(imageName);
>>> print(getInfo("window.title"));
>>> Knowing that the dialog is nonBlocking, it is still not possible to get the "Blobs" picture as selected (or in focus).
>>> This issue came from a plugin where I have stack which I would like to put as selected in order to the user to be able to browse through the stack without having the user to manually put the stack picture in focus.
>>> Thus is what I'm trying to do possible and if yes, how?
>>> I thank you very much in advance for your lighting on this.
>>> My best regards,
>>> Philippe
>>>
>>>
>>> Philippe CARL
>>> Laboratoire de Bioimagerie et Pathologies
>>> UMR 7021 CNRS - Université de Strasbourg
>>> Faculté de Pharmacie
>>> 74 route du Rhin
>>> 67401 ILLKIRCH
>>> Tel : +33(0)3 68 85 41 84
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

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