Advertisement
andrewb

yvonne2.r

Nov 11th, 2014
2,833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
REBOL 0.90 KB | None | 0 0
  1. rebol [
  2.     Title: "Yvonne View"
  3.     Version: 2.0
  4.     Purpose: [To learn a bit about REBOL.]
  5. ]
  6.  
  7. counter: 0
  8. ticks: 20
  9.  
  10. get-pic: func[] [
  11.     parts: parse read http://pics.mytrapster.com/yvonne.php {="}
  12.    to-image (load-image (load to-string parts/6))
  13. ]
  14.  
  15. set-size: func[ pic ] [
  16.    tx: pic/size/x + 20
  17.    ty: pic/size/y + 20
  18.    to-pair (as-pair tx ty)
  19. ]
  20.  
  21. reset-b: func[w i] [
  22.    temp: get-pic
  23.    i/size: temp/size
  24.    set-face i temp
  25.    w/size: set-size temp
  26.    show w
  27. ]
  28.  
  29. v1: layout [
  30.    at 10x10 b: image get-pic rate 1 feel [engage: func[f a e] [
  31.            if a = 'time[
  32.                if counter = ticks[
  33.                    counter: 0
  34.                    reset-b v1 b
  35.                ]
  36.                counter: counter + 1
  37.            ]
  38.        ]
  39.    ]
  40.    
  41.    at 10x10 btn "Refresh" [reset-b v1 b]
  42.    
  43.    at 75x10 btn "Quit" [quit]
  44. ]
  45.  
  46. view v1
  47.  
  48. do-events
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement