At 11:28 AM +0100 2002/08/10, Alan Fry wrote:
>At 2:14 pm -0700 09/08/02, Ulrich Wienands wrote:
>>I'd like - in the "redraw" event handler - to get access to the elements
>>of the bounding rectangle of the active window.
>
>It can be found from 'portRect' which is one of fields in the 
>window's 'GrafPtr', so you can call "$win->window->portRect". From 
>this you can get the 'top, bottom, left and right' values of the 
>window's rectangle (in local co-ordinates).
>
>If you are in a MacWindow's 'redraw' routine you can probably be 
>sure the active port is your MacWindow's port. If there is any 
>doubt, you can always call "SetPort($win->window)" first. It never 
>does any harm AFAIK.
>
>>What I eventually want to do is to rescale the contents of a window that
>>has its size changed. So my plan would be to use the bounding rectangle
>>info in the scaling relations from my drawing objects to the window
>>coordinates.
>
>That's sounds the way to go. I have some scripts which involve 
>rescaling and repositioning scroll-bars and text blocks as the 
>window is resized. I can let you have these if it would be helpful.

I'd sure like to see those scripts. Please post them.

Thanks!

David Seay
http://www.mastercall.com/g-s/

Reply via email to