Next Previous Up Top Contents Index

7.2.4 Display controls

7.2.4.4 Spin boxes

A <spin-box> is a collection gadget that only accepts a limited set of ordered values as input. To the right of the text field are a pair of buttons depicting an upward pointing arrow and a downward pointing arrow. Clicking on the buttons changes the value in the text field, incrementing or decrementing the value as appropriate.

Figure 7.16 A spin box

A typical spin box might accept the integers 0-50. You could specify a value in this spin box either by typing it directly into the text field, or by clicking the up or down arrows until the number 50 was displayed in the text field.

The gadget-items slot is used to specify the possible values that the spin box can accept.

Consider the following example:

make(<spin-box>, items: range(from: 6, to: 24, by: 2));

This creates a spin box that accepts any even integer value between 6 and 24.


Building Applications Using DUIM - 26 May 1999

Next Previous Up Top Contents Index