Average rating:
set exitcmd [lcdui.command -label Exit -longlabel Exit -type exit -priority 2]
set backcmd [lcdui.command -label Back -longlabel Back -type back -priority 1]
set addtextcmd [lcdui.command -label AddText -longlabel AddText -type screen -priority 1]
proc NewForm {} {
global exitcmd
global backcmd
global addtextcmd
set form [lcdui.form -title "Commands" -commandaction HandleCmd]
$form setcurrent
$form addcommand $exitcmd
$form addcommand $backcmd
$form addcommand $addtextcmd
}
proc HandleCmd {cmd form} {
global exitcmd
global backcmd
if { eq $cmd $backcmd } {
NewForm
} elseif { eq $cmd $exitcmd } {
[lcdui.alert -title "Goodbye" -text "Goodbye!" -type info -timeout forever] setcurrent
after 1000 midlet.exit
}
$form append "Blah blah"
}
NewForm