Loading...
 

SendMsg(..., DIRECT)

SendMsg(..., DIRECT)

SendMsg(message, DIRECT)

parameters: Name of a message

Stack
Stack Position Description
Stack(In) Top a window object or module or vector of widgets/modules
Top 1 any
top 2 . . .
Stack(Out) Top -

The message specified as a parameter is immediately sent to the window object or module located on the stack top. The receiver is transferred on the stack (see the Widget or Module instruction). If the receiver is a window object, the message is received by the window object and all children. If the receiver is a module, the message is received by the module and by all windows belonging to the module (and their children).

// At the start, send the message with the widget to response to! Button(CreateObjectBtn, 10, 10, 100, 8, T("Objekt erstellen", "Create object")) [ SELECT        : Widget SendMsg(CREATE_OBJECT) // The command "Widget" puts the actual button on the stack.   OBJECT_CREATED: -> newObject                   T("Objekt wurde erstellt!", "Object was created!") Attention(EndTXN, INFO) ] // Somewhere there is another module, which receives this message and does something with it: CREATE_OBJECT: // Receive the parameters from stack                -> sender                // Call the macro, which creates the object                CreateObject                // Send the message only to the sender! No broadcasting at all.                // No other module will recognize this message!                createdObject sender SendMsg(OBJECT_CREATED, DIRECT)

See also