[lazarus] Lazarus messaging

Michael A. Hess mhess at miraclec.com
Mon Jul 12 11:24:15 EDT 1999


Shane Miller wrote:
> 
> What is sent, or how do you control what is sent in the "msg" portion
> of the message procedure?  What is being sent there?  Can we control
> it.
> 
> The reason we need to control it is because when dispatching we need
> some way to send info to the message procedure.  For example:
> 
> GTKTEXT has a signal called INSERT-TEXT. The probelm is it sends the
> new text, new text length, and position.  How do we use that in our
> class.  How do we send that?


Not a problem. We will have to constantly adjust some of the SetCallback
routines and add some additional more complex versions. But here is what
needs to be done. The msg being sent to the Dispatch is a var msg. In
other words it can be anything it wishes. In our basic SetCallback the
value being passed is just the number used to indicated which message we
are calling (LM_CLICK, LM_RESIZE, etc.). However the msg can just as
easily be a complex record with the first item in the record being a
cardinal containing the message, LM_CLICK, etc.

In the callback routine that GTK is calling, you will just have to build
a complex record and that is the information you pass to the Dispatch
call. As long as the first item in the record is the message, you are
cooking. Look in the current documentation under Dispatch for an example
of this.

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list