[REBOL] Re: a scrollable window...
From: carl:cybercraft at: 22-Feb-2003 18:54
On 22-Feb-03, Tom Foster wrote:
> Hey guys,
> sorry for the easy question, but...
> I wrote a comic-grabbing script. If I grab more than two comics, the
> window displaying them goes off the screen. I _know_ there is an
> easy fix...
> this is the extremely complex code I use to display:
> view layout [
> banner "Comic 1"
> image %comic1.gif
> ;
> banner "Comic 2"
> image %comic2.gif
> ;
> banner "Comic 3"
> image %comic3.gif
> ]
> How can I make that thing scroll?
Hi Tom,
Here's a simple example that just changes the pictures' offsets to
make them scroll. Press the "u" or "d" keys to make it scroll. Hope
it's of some use...
rebol []
pics: copy []
loop 5 [
append pics to-image layout [box 400x200 random 255.255.255]
]
view lo: layout [
size 480x480 ; This stops the window getting too big.
text "Pic 1"
image pics/1 #"u" [
for pic 1 10 1 [
lo/pane/:pic/offset/y: lo/pane/:pic/offset/y - 50
]
show lo
]
text "Pic 2"
image pics/2 #"d" [
for pic 1 10 1 [
lo/pane/:pic/offset/y: lo/pane/:pic/offset/y + 50
]
show lo
]
text "Pic 3"
image pics/3
text "Pic 4"
image pics/4
text "Pic 5"
image pics/5
]
--
Carl Read