Community
Participate
Working Groups
I have a minute spinner and an hour spinner. I want the minute spinner to "spill over" into the hour one, so I created the code below: minuteSpinner.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { if (minuteSpinner.getSelection() >= 60) { minuteSpinner.setSelection(0); hourSpinner.setSelection(hourSpinner.getSelection() + 1); } } }); Problem is this works fine on Linux/GTK, but trying it on Windows modifyText seems to be called before the getSelection() value changes and not after like it does on Linux.. So on windows minutes goes up to 60 and then flips over while on Linux it goes up to 59 and then flips over.
Which version of SWT are you using? This sounds like bug 90223 which was fixed a few days after M6 came out.
I am indeed using M6 sorry I didn't note that. Upgrade of our application to M7 failed miserably so I cannot move there yet. So this is probably a dupe of that bug. so it sounds like the Linux behavior is correct and not the Windows one..
Works for me on M7. Should I close this as dupe of bug 90223 ? Here is the testcase: public static void main(String[] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout(new RowLayout()); final Spinner hourSpinner = new Spinner (shell, SWT.NONE); final Spinner minuteSpinner = new Spinner (shell, SWT.NONE); minuteSpinner.setMaximum(60); hourSpinner.setMaximum(12); minuteSpinner.setSelection(55); minuteSpinner.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { if (minuteSpinner.getSelection() >= 60) { minuteSpinner.setSelection(0); hourSpinner.setSelection(hourSpinner.getSelection() + 1); } } }); shell.pack(); shell.open (); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep (); } } display.dispose (); }
Is it a dup of 90233?
Yep, I tested this on M7 just now and it works fine. So its fixed in any case on M7... Sorry about that.
*** This bug has been marked as a duplicate of 90233 ***
Wrong dup.
Closing again. *** This bug has been marked as a duplicate of 90223 ***