Hi Giovanni,
yes I can reproduce it, also with a macro:
Dialog.create("Try with right arrow to go past 0.58");
Dialog.addSlider("Slider", 0., 1., 0.55, 0.01);
Dialog.show();
It looks like a Java bug to me; I could not find anything problematic in
ImageJ.
I tried two Java versions under Linux:
Java 1.8.0_345-b01
OpenJDK 64-Bit Server VM
java.vm.version: 25.345-b01
Zulu 8.64.0.19-CA-linux64
With this Java 8 version, when pressing the right arrow, it always hangs
at 0.57 and never steps up further.
Java 11.0.24
OpenJDK 64-Bit Server VM
java.vm.version: 11.0.24+8-post-Ubuntu-1ubuntu320.04
With this Java 11 version, one needs two clicks on the right arrow to
move from 0.57 to 0.58 and again two clicks from 0.58 to 0.59.
On the way back, it omits the 0.57 and jumps directly from 0.58 to 0.56.
I tried a few things like changing the "visible amount" (the width of
the bubble that one can drag) to 0 or adding IJ.wait(100) delays; it
does not fix the problem.
The adjustmentValueChanged callback is performed correctly, and the
AdjustmentEvent's getAdjustmentType() is also correct, UNIT_INCREMENT
=1 or UNIT_DECREMENT=2, but getValue() gets stuck (here at integer value
57).
Michael
________________________________________________________________
On 25.09.24 16:50, Cardone, Giovanni wrote:
Hi,
I experience the following issue when creating a GUI in jython containing a
slider with range 0 to 1.
Specifically, I cannot change the value beyond 0.58 when using the right arrow
in the slider.
However, I can move beyond this invisible limit moving the slider with the
mouse.
When trying the same with the wheel, I have to spin it very fast, otherwise it
gets stuck to the same limit.
I looked at the code and I can only see that the settings of the slider are
different, depending if the maximum value is below or above 5.
Below is the code reproducing the issue, at least on my Windows 11 computer.
Do you also experience this behavior?
Thank you.
Best,
Giovanni
from ij import IJ
from ij.gui import GenericDialog
gd = GenericDialog("Try with right arrow to go past 0.58")
gd.addSlider("Slider", 0., 1., 0.50, 0.01)
gd.showDialog()
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html