G4P GSpinner number update order

Hi,

I’ve been trying implement GSpinner but having an issue. Easily replicated in the G4P Example Numerical Input unmodified.
Load and run the G4P_NumericalInput example. Click on the up down spinner object. Number gets updated on the screen immediately, but the number displayed on the console message is the number before the change.
My symptoms are the same, I can see the number updated on the GUI but actions happen based on the previous number. How does one work on the current spinner number, not the previous?

Many Thanks
Stefan

This could be a bug in the source code because it works normally if you use the mouse scroll wheel but not if you click on the buttons.

I will check the source code today and see if I can find the problem.

I have confirmed this is a bug in the library and I have raised a ticket for it on Sourceforge.

This will be fixed in the next version which will be released very soon, perhaps even today.

I will report back here when done. :grin:

I have just uploaded version G4P V4.3.8 and it should be available in the Contributions Manager within a couple of days.

This version fixes the bug in the source code and made a slight change to the example code. G4P controls fire several types of event and most of the time you don’t have to worry about the event type. Good programming practice says that we should not just check the event source but also the event type. I have done this in the modified example. :grinning_face_with_smiling_eyes:

1 Like

Hi

As ever thanks so much for your efforts. Love your library, pretty much every project uses it in some form or another.

Stefan

Hi,

Just dragged it off Sourceforge. Works perfectly. Using the spinner number for the Index reference to access specific elements in JSON array. Does exactly what I expected now.

Many Thanks
Stefan