Package: gtk

Function gtk:spin-button-new-with-range

Lambda List

gtk:spin-button-new-with-range (min max step)

Arguments

min -- a double float with the minimum allowable value
max -- a double float with the maximum allowable value
step -- a double float with the increment added or subtracted by spinning the widget

Return Value

The new gtk:spin-button widget.

Details

This is a convenience constructor that allows creation of a numeric spin button without manually creating an adjustment. The value is initially set to the minimum value and a page increment of 10 * step is the default. The precision of the spin button is equivalent to the precision of step.

The way in which the precision is derived works best if step is a power of ten. If the resulting precision is not suitable for your needs, use the gtk:spin-button-digits function to correct it.

Notes

In the Lisp implementation the min, max, and step arguments are coerced to a double float number.

Examples

In this example the arguments of the function are given as integer numbers.
(defvar spinbutton (gtk:spin-button-new-with-range 5 15 5)) => SPINBUTTON
;; Get the adjustment of the spin button
(defvar adjustment (gtk:spin-button-adjustment spinbutton)) => ADJUSTMENT
;; Get the slots of the adjustment of the spin button
(gtk:adjustment-lower adjustment) => 5.0d0
(gtk:adjustment-page-increment adjustment) => 50.0d0
(gtk:adjustment-page-size adjustment) => 0.0d0
(gtk:adjustment-step-increment adjustment) => 5.0d0
(gtk:adjustment-upper adjustment) => 15.0d0
(gtk:adjustment-value adjustment) =>5.0d0    
 

See also

2023-9-30