Parent of Target

Sannyasin Brahmanathaswami brahma at hindu.org
Tue Aug 8 23:39:29 EDT 2017


The more we separate our code/libraries/behaviors from the binary UI, the more I find myself trying to dispatch call backs or other messages back to the group/card/stack that has a behavior and not the individual control: widget/button/field on the card itself, whose job was simply to intercept a mouse event and server as the target in higher switch.  So you need to get the long ID

widget id 1104 of card id 1002 of stack "/Users/Brahmanathaswami/Documents/_Siva-Siva-App/modules/listen/listen.livecode"

# widget is "downloadSelection"

so it seems a bit "hacky" but all I can think of to send a callback to the behavior attached to the card and not the widget itself is:

put the long ID of the target into pRequestedBy

delete word 1 to 4 of pRequestedBy

dispatch "someCommand" to "someOtherStack with  param1, param 2, sRequestedBy

# intent is, once load URL is done to close the download view dispatch update commands aback to the UI that initiated the Download: the stack "listen"

maybe hacky, but simple enough and well, this *is* supposed to be "English like coding"

but sometimes my code seems like "baby xTalk"   is there a better way?

OTOH Baby xTalk is more fun than C++!

BR














More information about the use-livecode mailing list