diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-07-21 10:12:35 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-07-21 10:12:35 -0400 |
commit | da2141fbf28e6173f587ee146acc8f78b7ea8e0d (patch) | |
tree | 69937e8dd046f5e3b3ea38f66061cdc8310351bc /demo/more/versioned1.ur | |
parent | 3e838a5bf95222adb9add226aa3732c3c28633bc (diff) |
Update demo code for key/mouse handler change
Diffstat (limited to 'demo/more/versioned1.ur')
-rw-r--r-- | demo/more/versioned1.ur | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/demo/more/versioned1.ur b/demo/more/versioned1.ur index 592af3cf..b5b23fb7 100644 --- a/demo/more/versioned1.ur +++ b/demo/more/versioned1.ur @@ -43,17 +43,17 @@ fun main () = {[kr.Key]}: <ctextbox source={kr.Nam}/> <ctextbox size={5} source={kr.ShoeSize}/> - <button value="Latest" onclick={ro <- rpc (current {Id = kr.Key}); - case ro of - None => alert "Can't get it!" - | Some r => - set kr.Nam r.Nam; - set kr.ShoeSize (show r.ShoeSize)}/> - <button value="Update" onclick={name <- get kr.Nam; - shoeSize <- get kr.ShoeSize; - rpc (update {Id = kr.Key, - Nam = name, - ShoeSize = readError shoeSize}) + <button value="Latest" onclick={fn _ => ro <- rpc (current {Id = kr.Key}); + case ro of + None => alert "Can't get it!" + | Some r => + set kr.Nam r.Nam; + set kr.ShoeSize (show r.ShoeSize)}/> + <button value="Update" onclick={fn _ => name <- get kr.Nam; + shoeSize <- get kr.ShoeSize; + rpc (update {Id = kr.Key, + Nam = name, + ShoeSize = readError shoeSize}) }/> </div></xml>) ks)}/> @@ -63,15 +63,15 @@ fun main () = <tr><th>Id:</th> <td><ctextbox size={5} source={id}/></td></tr> <tr><th>Name:</th> <td><ctextbox source={name}/></td></tr> <tr><th>Shoe size:</th> <td><ctextbox size={5} source={shoeSize}/></td></tr> - <tr><th><button value="Add" onclick={id <- get id; - name <- get name; - shoeSize <- get shoeSize; - rpc (insert {Id = readError id, Nam = name, - ShoeSize = readError shoeSize}); + <tr><th><button value="Add" onclick={fn _ => id <- get id; + name <- get name; + shoeSize <- get shoeSize; + rpc (insert {Id = readError id, Nam = name, + ShoeSize = readError shoeSize}); - cur <- get ks; - kr <- expandKey (readError id); - set ks (kr :: cur)}/></th></tr> + cur <- get ks; + kr <- expandKey (readError id); + set ks (kr :: cur)}/></th></tr> </table> <h2>Archive</h2> |