[lazarus] Lazarus messaging
Shane Miller
SMiller1 at stvgb.org
Mon Jul 12 12:32:46 EDT 1999
Yes. I see that. that is very cool, and actually works! I got the insert text signal working for TMemo. It send the record to it so it knows what's been added. Pretty slick.
My biggest problem I am having now is to find some way for the TMemo to realize that it's been changed. If people do a
Memo1.Lines.Add('This is cool!'); I have to find a way to let the TMemo class know something was added to it's lines property. I believe it's done through TMemoStrings.SetUpdateState but I'm not quite sure yet.
TMemo's is a bit more complex than TButton of TForms. :-)
Shane
>>> "Michael A. Hess" <mhess at miraclec.com> 07/12 10:24 AM >>>
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
_________________________________________________________________
To unsubscribe: mail lazarus-request at miraclec.com with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
More information about the Lazarus
mailing list