PASSing out with frustration

Jeff Massung massung at gmail.com
Wed Feb 16 11:15:55 EST 2011


Here's what I do for my toolbars... Create a transparent button. Edit the
script of the button in the following way:

on mouseDown
   ## do click effect
end mouseDown

on mouseUp
  ## undo click effect
end mouseUp

on mouseRelease
  mouseUp
end mouseRelease


Now, hide that button. Make a series of new buttons, and set their images to
whatever you need them to be. Also, set their "behavior" to be the long ID
of the button you previously just made and hid.

There, you have your series of buttons. Just make sure you pass along the
actions tot he behaviors. For example, let's say you had a toobar button to
copy the current selection:

on mouseUp
  set the clipboardData["text"] to the selection

  ## perform toolbarButton behavior
  pass mouseUp
end mouseUp

The "mechanics" is that basically there is a chain or stack of message
handlers. I know there's a link out there that has the exact order, but it
would go something like this:

Control
Behavior Button
Group
Card
Stack

If your control has mouseUp, it stops there. If you PASS mouseUp somewhere
in that script, it will check to see if the (optional) behavior button
handles it. If that executes some code and PASSes it along, it will check
the group, etc.

Hope this helps,

Jeff M.

On Wed, Feb 16, 2011 at 8:44 AM, Richmond <richmondmathewson at gmail.com>wrote:

> I have a series of images used as buttons
> with an optional overlay image that has
> both transparent and semi-opaque areas.
>
> When I mouse Down/Up over the opaque areas
> I want the mouse Down / Up signals to
> pass through the overlay to the images underlying it.
>
> But I cannot get my thick head around the mechanics of
> PASS.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the Use-livecode mailing list