Qu

ui_number

Builtin index · Plotting

result = ui_number(label, [default], [id=])

Input: label, default, id · Output: result

What it is

Declares a free-entry number box (for a value you type exactly rather than sweep), labeled label (string). default (number, positional, default 0) is the starting value; id= (string) as with ui_slider.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = ui_number(label, [default], [id=])
label number or stringDeclares a free-entry number box (for a value you type exactly rather than sweep), labeled label (string).
default number, optionaldefault (number, positional, default 0) is the starting value.
id string, optionalid= (string) as with ui_slider.
result number
Returns the current (or default) value as a number.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

freq = ui_slider("freq", 1, 20, 5)
gain = ui_number("gain", 1.0)
mode = ui_select("mode", ["fast", "slow"])
enabled = ui_checkbox("enabled", true)
pressed = ui_button("reset")
label = ui_text("label", "wave")
print(freq)
print(gain)
print(mode)
print(enabled)
print(pressed)
print(label)
output
5
1
fast
true
false
wave

from plotting

How it works

ui_number(label, [default], [id=])

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.