>Then you should add 1 to the result and have the range by one smaller...
Here's an edit of your patch, with the visible number pretty much de-coupled from the changing number. I stack two number boxes, the top most set to ignore click. This way the bottom number gets the click and changes, driving your modulo stuff, but the range of the visible top number can be set to anything. It could be a menu or some other display object, as long as it was set to ignore clicks.
Chris Muir | "There are many futures and only one status quo.
firstname.lastname@example.org | This is why conservatives mostly agree,
Here is an abstraction (called "rollo") I built a little while ago as an experiment to create a number box whose places don't jump. I ended up with an lcd solution to that problem, but you might find this patch useful. It is also designed to increment/decrement a neighboring number box. Included below also is an example patch:
Here is a small example patch. It looks for the above abstraction to be called "rollo".