object:setValue()

Type Function
Library widget.*
Return value none
Revision Release 2024.3703
Keywords widget, stepper, increment, decrement, StepperWidget, setValue
See also object:getValue()
object.value
widget.newStepper()
StepperWidget

Overview

This method sets the current value of a StepperWidget. Note that the value passed to this function will not adhere to the stepper's minimum or maximum value. For example, if the stepper has a maximum value of 10 and you pass 20 as the value parameter, the stepper's value will be 20. Thus, you should only pass in a value integer that is within range of your stepper's minimum and maximum values, if defined.

Syntax

object:setValue( value )
value (required)

Number. Integer at which to set the stepper's current value.

Example

-- Create a default stepper
local stepper = widget.newStepper
{
    left = 140,
    top = 235,
    minimumValue = 0,
    maximumValue = 50,
    initialValue = 5
}

stepper:setValue( 10 )