REBOL [
Title: "Simple Image Viewer"
Author: "Edoc"
Comments: {Views all JPEG files in current directory.}
]
file-list: []
foreach file sort load %./ [
if %.jpg = suffix? file [append file-list file]
]
UI: layout [
b: box "" 400x280
_img-name: text center 400 ""
across
_first: btn "|<" 80x32 blue center [
file-list: head file-list
b/image: load _img-name/text: file-list/1
show [_img-name b]
]
_back: btn "<< Back" 80x32 yellow center [
file-list: back file-list
b/image: load _img-name/text: file-list/1
show [_img-name b]
]
_next: btn "Next >>" 80x32 green center [
unless tail? next file-list [file-list: next file-list]
b/image: load _img-name/text: file-list/1
show [_img-name b]
]
_last: btn ">|" 80x32 orange center [
file-list: back tail file-list
b/image: load _img-name/text: file-list/1
show [_img-name b]
]
_close: btn "Close" 50x32 red center [unview]
]
b/image: load _img-name/text: first file-list
show [_img-name b]
view UI
This small script was written in REBOL and requires the free, cross-platform REBOL/View interpreter (around 400Kb). REBOL can be downloaded here.