Repeats and mouse events

Ken Norris (dialup) pixelbird at
Wed Feb 13 16:02:01 EST 2002

Hi Charles,

Jusy so you know, I'm making apps for the disabled, including children.

The following is a script I experimented with in Hypercard which uses the
addColor XCMD to color hilite buttons, rather than the B&W button Autohilite
property. It's simple, and can be used in an offscreen handler that will
make all the buttons which call it behave the same way, e.g., just like
autohilite. I'd think it would belong in a group script in RR. It's the
recoloring technique that you want to look at.

on mouseUp
end mouseUp

on autoColorHilite
  addColor,colorButton,bg,id of the target,"39321,26214,13107",2
  repeat while the mouse is down
    if the mouseLoc is within the rect of the target then
      addColor colorButton,bg,id of the target,"39321,26214,13107",2
    else addColor colorButton,bg,id of the target,"52428,39321,26214",2
  end repeat
  -- you can do all your mouseUp operations here OR use a mouseUp handler
end autoColorHilite

Mark Schonewille came up with this from my original inquiry.

I used it to also accomplish mouseUp actions common to all the buttons (the
note in the comment space), since they use 'the target' as well. I can see
no advantage to writing a separate mouseUp message to activate yet another
offscreen common handler in HC, but in RR I think you would use a group
handler, right?

...and for Scott R....

If you don't think this is valid scripting technique, please offer a RR
handler that accomplishes the same task. I'd be the first one to admit I
have HC habits that may not be necessary with RR. Not all of us in that
position are instantly cognitive of the differences, but need to get/keep
our apps running.

Hope all this helps.

Best regards,
Ken N.

More information about the Use-livecode mailing list