Extending the base widget class

This example shows how to extend the base Widget class to create a simple, re-usable spinner control. The Spinner class created in the example is not intended to be a fully featured spinner. It is used here as a concrete example, to convey some of the key concepts to keep in mind when extending the Widget class.
A basic spinner widget:

Click the buttons, or the arrow up/down and page up/down keys on your keyboard to change the spinner's value