Sending a message to multiple objects
sarah.reichelt at gmail.com
Wed Apr 21 19:18:27 EDT 2010
> 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.
There was an MVC demo stack doing the rounds a couple of years ago. I
think it used something similar to this where controls registered
their interest and then all registered controls got the specified
messages. I forget who wrote the stack, but a search for "MVC.rev"
might turn up something. Or maybe the original author could step in
here before my vague memories cause too much confusion :-)
More information about the Use-livecode