Name

lcdui.textfield — Creates a small text editing widget that can be attached to a form.

Synopsis

lcdui.textfield -label label -text text -maxlen maxlen -type any | emailaddr | numeric | phonenumber | decimal

$textfieldcmd [cget -type | -text | -maxlen | -password | -uneditable | -sensitive | -non_predictive | -initial_caps_word | -caretposition ] [ configure -type type | -text text | -maxlen maxlen | -password 1 | 0 | -uneditable 1 | 0 | -sensitive 1 | 0 | -non_predictive 1 | 0 | -initial_caps_word 1 | 0 ]

Description

The lcdui.textfield command creates a one-line text editing widget that can be attached to a form. For an in-depth look at the Java code that this command is based on, see: javax.microedition.lcdui.TextBox

Example

set evalcmd [lcdui.command -label Evaluate -longlabel Evaluate]
set textfield [lcdui.textfield -text {[lcdui.alert -text "hi!"] setcurrent}]
set form [lcdui.form -title "Text Field Example" -commandaction \
    [list runCode $textfield]]
$form append $textfield
$form setcurrent
$form addcommand $evalcmd

proc runCode {txtfld cmd frm} {
    eval [$txtfld cget -text]
}

Live example: http://www.heclbuilder.com/scripts/show/154