MIDP Version: 1.0
Description: A simple shopping cart that connects to this web page to download the list of stuff to buy: http://dedasys.com/shopping_cart/ Last updated: Mon Oct 06 02:25:05 +0000 2008 by
davidw
proc complete? {lb} {
set l [getprop $lb selected]
foreach v $l {
if { = $v 0 } {
return
}
}
setprop $lb label "Done!"
}
proc getlist {listname} {
global shoppinglist
set code [getprop $listname text]
set shoppinglist [split [http http://dedasys.com/shopping_list/getlist.tcl?listid=$code] \n]
}
set f [form label "Shopping List - Select a List" code {
set listname [textfield label "Shopping list id number:" type numeric]
string "Insert the numeric code that you received from http://dedasys.com/shopping_list/ to recieve your shopping list."
cmd label "Get list" code {
set lb [listbox label "Shopping list - things to get" type multiple callback {
complete? $lb
}]
setcurrent $lb
getlist $listname
foreach item $shoppinglist {
string $item
}
}
}]
setcurrent $f