![]() |
oneliner-image-viewer.rAuthor: Vincent Ecuyer Contents:1. Purpose2. Usage 3. Commented Code 1. Purpose
2. Usage
3. Commented Code; Opens a new window, and stores the face! in 'l for later usage. view l: layout [ ; Uses the full window surface origin 0x0 ; Labelled 100x100 box, which will serve as storage for pictures b: box "Load" [ ; Actions executed on a click. "error? try" is the same as "attempt" in ; later versions: in case of error, exits the function but don't crashe error? try [ ; requests a file and try to load it - 'i stores the image too for later access b/image: i: load first request-file ; if loading is a success, the text isn't needed anymore, so clears it b/text: "" ; resizes both the window ('l) and the box ('b) to the image ('i) size l/size: b/size: i/size ; updates the display show l ] ] ] |
![]() | MakeDoc2 by REBOL - 29-Jan-2013 |