Resizing During Resizing

MisterX b.xavier at internet.lu
Sun Nov 13 12:39:08 EST 2005


Hi Rob,

most routines I use to resize stack windows rely on the
stack's rect instead of the width or height of the window.

Since resizing the width/height displaces the topleft point
of the window, you have to be careful that you don't jitter 
the windowborder you are grabing and the mouseloc...

The RectResize is a bit more complicated I think...

Also, the mouse changes the window's size and then it sends
a resizestack message. So it's tricky to see what happens
when you do that... who gets the priority to the resize
position of the window? you set it to A, your script sets it
to B and as it resizes the border was B must go to the next A.

Unlock the screen to see what happens. Jittery resize of the
window?

Also it maybe safer to separate the window resize handler
from the resizestack and call it from there.

on resizeStack
  lock messages
  doMyWindowResiteAdjustment
  unlock messages
  pass resizestack
end resizeStack

About Lock Screen...

Don't use it. It should work ok without it or you're doing
something wrong ;). If you see jitter, lock screen for any
repeat control positioning loops involved in the resizeevent. 


-- that and a lot more in a 3 letter stack I've been talking
about lately.

So far I've observed those as good guidelines and they've 
served me well in most of my resizeable palettes, splitters,
etc...

hope it helps. hope it wasn't too xtalkish...

cheers
Xavier
http://monsieurx.com rev it up




> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Rob Cozens
> Sent: Sunday, November 13, 2005 17:20
> To: How to use Revolution
> Subject: Resizing During Resizing
> 
> Hi All,
> 
> I want to be able to change the height or width of a stack 
> from inside the stack's resizeStack handler without 
> triggering a second resizeStack message.
> 
> I have created a portfolio of photographs of my wife's art.  
> All photos have a 3 (w) to 2 (h) orientation/proportion and 
> the stack layout is designed to retain same.  In resizeStack, 
> I check to see whether the user has resized the height to a 
> greater degree than the width or vice versa, and then change 
> the other dimension to retain the 3 to 2 proportion.  Here is 
> a test handler based on my handler:
> 
> on resizeStack newWidth,newHeight,oldWidth,oldHeight
>    beep
>    lock screen
>    put abs(newWidth-oldWidth) into widthDifference
>    put abs(newHeight-oldHeight) into heightDifference
>    lock messages
>    if widthDifference >= heightDifference then set the height 
> of this stack to trunc((newWidth/3)*2)
>    else set the width of this stack to trunc((newHeight/2)*3)
>    unlock messages
>    unlock screen
> end resizeStack
> 
> When I run this handler I hear two beeps, indicating that a 
> resizeStack message is sent when a stack dimension is changed, even 
> though I have locked messages.   I suppose I could add logic to set 
> and check a local variable; but I'm wondering--
> 
> 	* Does this happen in 2.6.1?
> 	* Why does the second resizeStack message get sent when 
> messages are locked?
> 	* Why doesn't the logic loop recursively (ie: why 
> doesn't the second resizeStack message trigger a third)?
> 
> Rob Cozens CCW
> Serendipity Software Company
> 
> "And I, which was two fooles, do so grow three;
>   Who are a little wise, the best fooles bee."
> 
>   from "The Triple Foole" by John Donne (1572-1631)
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage 
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list