[comp.sys.mac.hypercard] MoveWindow and SizeWindow messages

ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) (06/10/91)

I discovered these while messing about last week. So far I've tried them
with card windows: HyperCard sends the "MoveWindow" message once you've
moved a window, and the "SizeWindow" message after you've pulled up the
grow icon with command-shift-E and used it to resize the window. Neither
message is passed any arguments. I assume the messages get sent to the
current card.

If you do a "set rect of card window", it sends "MoveWindow" if the
top-left corner moves, and "SizeWindow" only if the window changes size
without its top-left corner moving.

A quick scan of Winkler and Kamins' tome failed to uncover any mention
of these messages.

By the way, I was doing my experimentation with 2.0v2, not 2.1.

Can anybody shed further light on this?

Lawrence D'Oliveiro                       fone: +64-71-562-889
Computer Services Dept                     fax: +64-71-384-066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
To someone with a hammer and a screwdriver, every problem looks
like a nail with threads.

jkc@Apple.COM (John Kevin Calhoun) (06/10/91)

In article <1991Jun10.193400.3931@waikato.ac.nz> ldo@waikato.ac.nz
(Lawrence D'Oliveiro, Waikato University) writes:
>I discovered these while messing about last week. So far I've tried them
>with card windows: HyperCard sends the "MoveWindow" message once you've
>moved a window, and the "SizeWindow" message after you've pulled up the
>grow icon with command-shift-E and used it to resize the window. Neither
>message is passed any arguments. I assume the messages get sent to the
>current card.
>
>If you do a "set rect of card window", it sends "MoveWindow" if the
>top-left corner moves, and "SizeWindow" only if the window changes size
>without its top-left corner moving.
>
>A quick scan of Winkler and Kamins' tome failed to uncover any mention
>of these messages.
>
>Can anybody shed further light on this?

Once again, I'm the culprit.  My notes say that I implemented these at the
end of July last year, after it was too late to make changes in Dan's book.
My notes also say...

   In the following cases, when the card window is moved you get a
   "moveWindow" message.
   
     1)  The window is dragged to a new location.
     2)  The window is zoomed in or out, and the loc of the window is
         thereby changed.
     3)  A script sets the loc of the card window to a new point.
     4)  A script shows the window at a new location.
     5)  A script sets the rect of the card window, and the loc of the
         window is thereby changed.
     6)  The window is resized from the scroll palette, and the top left
         of the window is thereby changed.
     7)  A script sets the rect of the card to a new rectangle, and the
         top left of the window is thereby changed.
   
   The sizeWindow message is sent when the card window is resized, in
   the following cases.
   
     1)  The window is resized from the size box.
     2)  The window is resized from the scroll palette.
     3)  The window is zoomed in or out, and the size of the window is
         thereby changed.
     4)  A script sets the rect (or the height, width, etc.) of the card
         window to a new rectangle.
     5)  A script sets the rect of the card to a new rectangle, and the
         resizing of the card causes a resizing of the card window.
   
   Note that in all cases of the sizeWindow message except the first, a
   moveWindow message may also be sent.  When both messages are pending,
   the sizeWindow message is sent first.


Kevin Calhoun
jkc@apple.com