Object SendMessage

BlitzMax Forums/BlitzMax Programming/Object SendMessage

assari(Posted 2006) [#1]
Can someone pls give a simple example on how to use the SendMessage method?
It seems to have a syntax of
SendMessage:Object( message:Object,sender:Object )

Thanks in advance


Eric(Posted 2006) [#2]
bump... Has anyone found a use for this?


Byteemoz(Posted 2006) [#3]
The MaxIDE (both BRL and CE version) use a similar mechanism to send messages like "refresh your content", "copy selected text", "indent selected text" between the various objects within the program (code panels, dialogs, navigation panels or the debugger).
Even though it doesn't use SendMessage, the actual method is
Invoke:Int(Message:Int, Param:Object)
the concept in both cases is to provide a low-level interface for objects to communicate.
IMHO the the SendMessage method is a little too "generic" to be used efficiently - for example if you want to send an Int as message, you'd have to wrap it into a type first - and its easier to let every type have an individual set of methods / functions than using the one method for everything.

-- Byteemoz