dlg_add_txt_input()

Adds a text input field to a dialog.

The input field can be single-line or multiline.

Syntax

planetcnc.dlg_add_txt_input(handle, name, text=None, multiline=False, param=None)

Parameters

Parameter Type Description Comment
handle string Handle of the dialog to modify.
name string Name identifier for the input field.
text string Initial text to display in the input field. optional
multiline bool `True` for a multiline input field. 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 single-line text input field
planetcnc.dlg_add_txt_input(dlg_handle, "Single", "Hello, World!")
 
# Add a multiline text input field
planetcnc.dlg_add_txt_input(dlg_handle, "Multi", "The quick brown\nfox jumps over\nthe lazy dog", True)
 
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