Sending a message to multiple objects

Peter Haworth pete at mollysrevenge.com
Wed Apr 21 11:44:49 EDT 2010


Thanks for the suggestions.

I knew about the dispatch command (and send).  And yes, any control on  
any card in my app could be interested in the message I want to  
generate, not just the current card so would have to modify the loop  
but I think I have code to iterate through every stack/card/control  
already in place..

Basically what I'm trying to do is have controls which display data  
from my SQLite database (mostly datagrids) refresh the data when it  
gets changed outside the stack they reside on so it would be a small  
percentage of the controls that would have an interest in the message.

I had thought of creating a registry of controls that have an interest  
when data in a particular table in the database changes.  Perhaps a  
custom property in each stack that holds a list of interested controls  
when the data is changed in that stack, then key the dispatch commands  
off that custom property.  Could be complicated to keep up to date  
though.

Pete Haworth










More information about the use-livecode mailing list