how to resize a backdrop
[1/11] from: arolls:idatam:au at: 15-Nov-2001 15:38
I have figured out a method to make the backdrop resize. I believe there must be a better way to increase the size of the clip region and refresh, but I am using WAIT here: rebol  view/new lay: layout [size 200x200 bd: backdrop blue effect [gradient]] lay/size: lay/size + 40x40 show lay wait 4 ; not necessary - just for demo bd/size: bd/size + 40x40 show bd wait 0 ; a WAIT here is necessary wait none ; wait for user to press close Anton
[2/11] from: media:quazart at: 15-Nov-2001 8:22
yes, this works because a gradient is a dynamic effect, so if you change any face's size and if a gradient is applied to it, it will scale along with it (so long as you 'show the face again). -MAx
[3/11] from: ammonjohnson:yah:oo at: 15-Nov-2001 17:44
What is the wait necessary for? I couldn't see any difference, running it with or without the wait that you say is necessary. The backdrop resizes nicely for me regardless of that wait. Enjoy!! Ammon ---- Original Message -----
[4/11] from: arolls:idatam:au at: 16-Nov-2001 13:24
If you type it in line by line you will see... :)
[5/11] from: carl:cybercraft at: 17-Nov-2001 12:27
On 16-Nov-01, Ammon Johnson wrote:
> What is the wait necessary for? I couldn't see any difference, > running it with or without the wait that you say is necessary. The > backdrop resizes nicely for me regardless of that wait.
On my Amiga the window resizes but the backdrop doesn't resize to fit it, though the gradient has changed to reflect the larger size. So, at the end, I've still a bare band around the right and bottom. Is there some cross-platform issues here? Or perhaps a bug in Amiga View? The gradient should end up filling the whole of the window, shouldn't it?
> Enjoy!! > Ammon
<<quoted lines omitted: 18>>>> wait 0 ; a WAIT here is necessary >> wait none ; wait for user to press close
-- Carl Read
[6/11] from: ammonjohnson:yah:oo at: 16-Nov-2001 18:12
This could very well be an Amiga only problem. I experience no need to have the wait. I tried running with, & without - in the Console, & Script based - all with the EXACT same behavior. HTH Ammon
[7/11] from: arolls:idatam:au at: 19-Nov-2001 17:44
No no. I see this very problem on windows NT4 (and 2000, I am pretty sure...) That's why I was experimenting to find a solution. Here is a console session that works for me:
>> view/new lay: layout [size 200x200 bd: backdrop blue effect [oval]] >> lay/size: lay/size + 50x50
>> bd/size: bd/size + 50x50
>> show lay
; here I see backdrop is still clipped too small ; although oval has been redrawn in larger size ; see http://anton.idatam.com.au/rebol/bugs/images/bg-clip.png
>> wait 0.001
; here I see clip box expands to correct size ; and can see all of the oval again == none And I made a mistake in my last post. The first [wait 0] is not quite enough. I need to wait some amount time (greater than zero). I shouldn't have included the second [wait none] as that just confused the issue. [wait none] also causes the backdrop to resize... Anton.
[8/11] from: media:quazart at: 19-Nov-2001 7:50
Hi Carl, I tried using glass on amiga this week-end and it works although x-tremely slow on a 50MHz A1200 ... but I also noticed that the view system thinks the window does not have borders, so it draws gfx UNDER the window edges... !! -MAx
[9/11] from: brett:codeconscious at: 20-Nov-2001 1:52
> No no. I see this very problem on windows NT4 > (and 2000, I am pretty sure...)
Yes I'm using NT4 I can see what you describe. It true that the resize of the backdrop does not display until the wait. Must be some special event that needs to be processed. I missed the reason (just came in to the thread) why you found this to be a problem though. As the following works fine (because a event processing is occurring): view lay: layout [ size 200x200 bd: backdrop blue effect [oval] button "resize" [ lay/size: lay/size + 50x50 bd/size: bd/size + 50x50 show lay ] ] What circumstance is it that you need to display a resize of the backdrop without event processing being in operation? Brett
[10/11] from: ammonjohnson:yaho:o at: 19-Nov-2001 16:41
Hmm... OK, now I see what you are talking about, it appears that the /View window thinks that it needs to be the "active" REBOL window (the one recieving request from the user) before it feels that it is important enough to properly SHOW itself. I will keep my eye on this one, & let you know if I figure something out! Sorry I couldn't be of more use... Ammon
[11/11] from: arolls:idatam:au at: 20-Nov-2001 14:57
Well, since I figured out how, it's not a problem. Just when conducting my tests to find out how to do it, I started with view/new ... so I couldn't see how to do it properly.
> What circumstance is it that you need to display a resize of > the backdrop > without event processing being in operation? > > Brett
Also, here is a way to ensure that the backdrop is redrawn correctly underneath a text: view lay: layout [ origin 0 bd: backdrop effect [gradient] t: text "hello there" [ append t/text " rebol" t/size: t/size + 40x0 ; room to accommodate longer text t/saved-area: none ; forget the image bd/size: lay/size: 4x4 + size-text t show lay ] ] Anton.
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted