[comp.sys.mac.hypercard] More Simultaneous Scrolling Fields

cs2531as@charon.unm.edu (Andrew Stone) (05/02/88)

Here's another solution, that does not require mouselocs, and thus
allows flexible resizing of fields.

Identical script in each field: (let's say there are 3 of them)

on mousewithin
  global thetarget, thescroll
  put the target into thetarget
  put the scroll of me into thescroll
  set lockmessages to true
  doscroll
  set lockmessages to false
end mousewithin

In the card or background or stack script goes the doscroll handler:

on doscroll
  global thetarget,thescroll
  if thetarget is "card field id 1" then
    set the scroll of card field id 2 to thescroll
    set the scroll of card field id 3 to thescroll
  else if thetarget is "card field id 2" then
    set the scroll of card field id 1 to thescroll
    set the scroll of card field id 3 to thescroll
  else if thetarget is "card field id 3" then
    set the scroll of card field id 2 to thescroll
    set the scroll of card field id 1 to thescroll
  end if
end doscroll

Get a MacII if you want this to be fast enough to be acceptable!!
(About a second to get all three equivalent).

Better solutions solicited!


	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	|	Andrew Stone     GEnie:ASTONE      505-345-4800		|
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         		UUCP: cs2531as@charon.unm.edu          
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	|      	"Laugh while you can,MonkeyBoy!" - John BigBoote        |
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

gjditchfield@violet.waterloo.edu (Glen Ditchfield) (05/10/88)

In article <2988@charon.unm.edu> cs2531as@unmc.UUCP (Andrew Stone) writes:
<Identical script in each field: (let's say there are 3 of them)
<
<on mousewithin
<  global thetarget, thescroll
<  put the target into thetarget
<  put the scroll of me into thescroll
<  set lockmessages to true
<  doscroll
<  set lockmessages to false
<end mousewithin
<
<In the card or background or stack script goes the doscroll handler:
<
<on doscroll
<  global thetarget,thescroll
<  if thetarget is "card field id 1" then
<    set the scroll of card field id 2 to thescroll
<    set the scroll of card field id 3 to thescroll
<  else [more of the same]
<end doscroll
<
<Get a MacII if you want this to be fast enough to be acceptable!!
<(About a second to get all three equivalent).

It's been a while since I did this, but I would suggest surrounding doScroll's
body with "set lockscreen to false...set lockscreen to true".  I also had
to call doScroll from a mouseLeave handler;  I found that otherwise I could
scroll one field, and get the cursor out of the field before the next
mouseWithin message got sent.  To me, it looked like there was a one-second
interval between mouseWithins, as opposed to doScroll taking one second.