Re" Rev suport user defined events?

Richard Gaskin ambassador at fourthworld.com
Mon May 18 11:06:10 EDT 2009


DunbarX wrote:
> In HC, and I would bet in Rev, messages are sent regardless of whether 
> there is a handler to trap them. If none, the message passes right through the 
> engine into the ether. I don't know if there would be a savings in overhead 
> to discard such messages at the outset; I suppose it would not hurt. At 
> compile time Rev would have to examine all scripts everywhere, checking for 
> matches.

There are tradeoffs both ways, one in sending unused messages and the 
other in setting up flags for which messages get sent.

Rev generally sends all messages regardless whether they're handled or 
not, with a few exceptions:

- idle: it's far more efficient to use "send <message> in <time>" so 
this message is only sent if you have an idle handler in your message path.

- mouseWithin: mouseMove is much more efficient, so this message is only 
sent to controls which contain a mouseWithin handler.

- messageHandled/messageNotHandled:  undocumented and subject to change, 
these messages are only sent when you set the global property 
messageMessages to true.  They're useful for some logging operations but 
take a toll on overall performance, so the messageMessags is off by default.

Can anyone here think of other messages not normally sent by default?

--
  Richard Gaskin
  Fourth World
  Revolution training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com



More information about the use-livecode mailing list