[lazarus] Lazarus messaging
michael at tfdec1.fys.kuleuven.ac.be
michael at tfdec1.fys.kuleuven.ac.be
Mon Jul 12 13:36:44 EDT 1999
On Mon, 12 Jul 1999, Shane Miller wrote:
> 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.
Simply set the TStrings OnChange event:
Constructor TMemo.Create (AOwner : TComponent)
begin
MemoStrings:=TStringList.Create;
MemoStrings.OnChange:=@self.UpdateStrings;
end;
Any time the MemoStrngs stringlist changes, you are notified.
Michael.
More information about the Lazarus
mailing list