IupSpin and IupSpinBox

This functions will create a control set with a vertical box containing two buttons, one with an up arrow and the other with a down arrow, to be used to increment and decrement values.

Unlike the SPIN attribute of the IupText element, the IupSpin element can NOT automatically increment the value and it is NOT inserted inside the IupText area. But they can be used with any element.


IupSpin inherits from a IupVbox, and contains two IupButton.

Ihandle* IupSpin(void); [in C]
iup.spin{} -> (ih: ihandle) [in Lua]
spin() [in LED]

Returns: the identifier of the created element, or NULL if an error occurs.

IupSpinbox is an horizontal container that already contains a IupSpin.

Ihandle* IupSpinbox(Ihandle* child); [in C]
iup.spinbox{child: ihandle} -> (ih: ihandle) [in Lua]
spinbox(child)  [in LED]

Returns: the identifier of the created element, or NULL if an error occurs. 

child: Identifier of an interface element which will receive the spinbox around.


SPIN_CB: Called each time the user clicks in the buttons. It will increment 1 and decrement -1 by default. Holding the Shift key will set a factor of 2, holding Ctrl a factor of 10, and both a factor of 100.

int function(Ihandle *ih, int inc); [in C]
ih:spin_cb(inc: number) -> (ret: number) [in Lua]


The spinbox can be created with no elements and be dynamic filled using IupAppend or IupInsert.


Ihandle* spinbox = IupSpinbox(IupText(NULL));

See Also

IupText, IupVbox, IupHbox, IupButton