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 function gtk-spin-button-digits to correct it.

Note

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

Example

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

2021-2-10