dlg_add_num_input()

Adds a numerical input field to a dialog.

The input field can have an initial value, min/max range, decimal precision, and an optional parameter name.

Syntax

planetcnc.dlg_add_num_input(handle, name, value=0, min=-1000000, max=1000000, decimals=3, param=None)

Parameters

Parameter Type Description Comment
handle string Handle of the dialog to modify.
name string Name identifier for the input field.
value float Initial value of the input field. optional
min float Minimum allowed value. optional
max float Maximum allowed value. optional
decimals int Number of decimal places to allow. optional
param string Optional parameter name for value storage. optional

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
dlg_handle = planetcnc.dlg_new("Examples")
 
# Add a numerical input field with default settings
planetcnc.dlg_add_num_input(dlg_handle, "Mv Value", 0, 0, 100, 0)
 
planetcnc.dlg_show(dlg_handle)

See also

dlg_add_option
dlg_add_separator
dlg_add_image
dlg_add_label
dlg_add_checkbox
dlg_add_num_input
dlg_add_txt_input
dlg_add_dropbox
dlg_add_button