Devin Asay devin_asay at
Mon Sep 18 19:21:41 EDT 2017


Maybe the best way to do this is to use the before or after control structure in the behavior, rather than the menuPick.

before menuPick pItem
  # do common behavior stuff here
end menuPick

That leaves the menuPick handler unencumbered in the actual object.


On Sep 18, 2017, at 5:14 PM, Bob Sneidar via use-livecode <use-livecode at<mailto:use-livecode at>> wrote:

Hi all.

I've decided to start in on behaviors now as I have so much code that is effectively identical. So I took the code from a menu/button with a menuPick handler and put it in another button, then set the behavior of the first button to the long id of the second. I then set a breakpoint in the behavior script. I still have a menuPick handler in the first button to handle special case menu items for that card, but I commented out the code that is common between them.

The trouble is, selecting the menu item does not trigger the behavior. I tried setting pass menuPick in each one, but still no bueno. So which one gets the message first/at all? The behavior or the actual button?

Bob S

use-livecode mailing list
use-livecode at<mailto:use-livecode at>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

Devin Asay
Office of Digital Humanities
Brigham Young University

More information about the Use-livecode mailing list