[REBOL] Re: tool for resizable windows posted
From: agem:crosswinds at: 31-May-2001 0:05
>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 30.05.01, 22:07:47, schrieb "Ronald Gruss"
<[ronald--gruss--libertysurf--fr]> zum Thema [REBOL] Re: tool for resizable
windows posted:
> Hi Volker,
> Don't know the purpose of your script ??
> Why don't you use
> REBOL[]
> faces: layout [
> button "quit" [Boo!...]]
> faces/options: [resize]
> faces/color: water
> view/offset faces 200x100
> Answer of a Newbie trying to understand...
'cause of
faces: layout [
button "quit" [Boo!...]
area 320x240
]
the area keeps it's size when you change window size. I want it to
take the new space.
Like with rebols editor.
So i examined rebols editor a bit and made a function of its
resize-event-catcher.
Looking at the resize-calculations, i thought maybe it could be more
general.
based around
func [SIZE-DIFF] [
layout [
across
t1: area SIZE-DIFF + 320x240 para [] my-text
s1: slider SIZE-DIFF * 0x1 + 16x240 [scroll-para t1 s1]
]
]
base-size is calculatet with size-diff set to 0x0,
the function is recalculated on every resize-event,
with size-diff being the difference to the original size.
So if you extend window with 50x100,
area will grow to 50x100 + 320x240 , slider to 0x100 + 16x240 .
Now i discovered a problem:
how to copy data from the old layout to the new best?
In this example it works, because t1 does its editing in 'my-text,
but if you do [t1/text: »some text«]] and resize, that change would be
lost.
[insert clear t1/text »some text«] should work. but is uncommon?
I am thinking about some support for copying facets from old to new
layout,
but not sure about the best way. How? Is it needed? Opinions?
-Volker