lcdui.form — Creates a form that can contain various widgets


lcdui.form [-title title] [-ticker tickerwidget] [-commandaction commandActionProc]

$formcmd [cget -optname ] [configure -optname optval ] [size] [append string | image | widget ] [item itemnum ] [delete itemnum ] [deleteall ] [setcurrent ]


The lcdui.form command creates a form, returning a command/object that can be used to further manipulate the created form. For an in-depth look at the Java code that this command is based on, see: javax.microedition.lcdui.Form

The subcommands accepted by the $formcmd that lcdui.form returns are as follows:

  • cget: Fetch configuration options.

  • configure: Set configuration options.

  • item itemnum: Return the item identified by itemnum.

  • delete itemnum: Delete the item identified by itemnum.

  • deleteall: Delete all items associated with this form.


set choicegroup [lcdui.choicegroup -label Choice -type popup]
foreach x {c1 c2 c3} {
    $choicegroup append $x
set ticker [lcdui.ticker -text "I am a Ticker!"]

set form [lcdui.form -title "Example Form"]
$form setcurrent
$form configure -ticker $ticker
$form append [lcdui.textfield -label "TextField" -text "TextField" -uneditable 1]
$form append [lcdui.textfield -label "Editable TextField" -text "editable text"]
$form append [lcdui.imageitem -image $logo -anchor center]
$form append [lcdui.spacer -label spacer1 -minwidth 200 -minheight 2]
$form append [lcdui.stringitem -text "Stringitem"]
$form append [lcdui.spacer -label spacer2 -minwidth 200 -minheight 4]
$form append [ -label "Date/Time" -date [clock time]]
$form append $choicegroup
$form append [lcdui.imageitem -image $logo]
$form append [lcdui.gauge -label "How cool is Hecl?" -interactive 1 \
		     -value 10 -maxvalue 10]

Live example: