This is a blog about Rebol, it's a fantastic free programming language, it permits easily to create complete software with few lines of code. It's cross-platform, so if you write it on Windows, it will work on Linux and Mac, and vice-versa. You can produce also wonderful GUI with just 3 lines of code!
Monday, 3 December 2012
The following script is an image browser:
You can mix easily this script with other script about image manipulation and drawing, like.
insert-event-func [ either event/type ='resize [ ;resize all widgets wih one line: ;print imageb/parent-face/size/y icon-list/size/y:sc/size/y:imageb/size/y: imageb/parent-face/size/y -120 imageb/size/x: imageb/parent-face/size/x -140 show [icon-list sc imageb]
none ; return this value when you don't want to do anything else with the event. ][event ; return this value if the specified event is not found ] ] ;-- Main display: view/optionslayout [
title reform ["REBOL" system/script/header/title system/script/header/version]
button "Change dir..." [ change-dirrequest-dir
newset icon-list/pane: temp sc/data:0 show [icon-list sc]
toggle "fit""aspect" [either face/state [ imageb/effect:'aspect] [imageb/effect:'fit] show imageb] image-name: text 280 return icon-list: box 70x400 edge [size:1x1]with [pane: temp] sc: slider 15x400 [ delta:abs ( icon-list/size/y - temp/size/y) icon-list/pane/offset:as-pair0 (-1* face/data * delta) show icon-list
] imageb: box 400x400 main-color