waitForUser in jython?

fiji
Tags: #<Tag:0x00007fa3070ee140>

#1

Hi all,

I’m rewriting a macro that I did a couple of months ago this time in Jython, but I can’t seem to find a good solution for replacing the waitForUser command. Found it in Java and the macro language however.
Am I missing something ?

Thanks a lot.


#2

Hi lguerard -

The beauty of jython is that you can access (more or less)
everything provided by java. You can use not only jdk-provided
java classes, but – more to the point – all of the ImageJ /
Fiji java classes (and ImageJ / Fiji is written in java, so
that means more or less all of Fiji).

So if you know how to do waitForUser in java, you can do
it in your python (jython) script:

from ij.gui import WaitForUserDialog
myWait = WaitForUserDialog ("myTitle", "myMessage")
myWait.show()

Thanks, mm


#3

That indeed seems to work very well ! Thanks :slight_smile: