Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rebol [
- Title: "Lady Lawful Client"
- Version: 0.1
- Purpose: [To learn a bit more about REBOL.]
- ]
- prtz: []
- get-ll-json: func [jurl] [
- json: read jurl
- parts: parse json {[{" "} "," ":"]}
- clear prtz
- foreach [p] parts [
- if not zero? length? p [ append prtz p ]
- ]
- prtz
- ]
- getPic: func [gurl] [ to-image (load-image (load to-string gurl)) ]
- getPrev: func [] [ get-ll-json http://ladylawful.com/prev ]
- getNext: func [] [ get-ll-json http://ladylawful.com/next ]
- getCurrent: func [] [ get-ll-json http://ladylawful.com/img ]
- picFull: func [ json ] [ json/2 ]
- picSmall: func [ json ] [ json/4 ]
- picThumb: func [ json ] [ json/6 ]
- setSize: func[ pic ] [
- tx: pic/size/x + 20
- ty: pic/size/y + 20
- to-pair (as-pair tx ty)
- ]
- refreshPic: func [w i n] [
- i /clear
- i/size: n/size
- set-face i n
- w/size: setSize n
- show w
- ]
- v1: layout [
- at 10x10 b: image getPic picSmall getCurrent
- at 10x10 btn "PREV" [
- refreshPic v1 b getPic picSmall getPrev
- ]
- at 60x10 btn "NEXT" [
- refreshPic v1 b getPic picSmall getNext
- ]
- at 110x10 btn "QUIT" [quit]
- ]
- view v1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement