[lazarus] Has message handler stuff been implemented yet???

michael at tfdec1.fys.kuleuven.ac.be michael at tfdec1.fys.kuleuven.ac.be
Sun May 16 16:15:40 EDT 1999




On Sun, 16 May 1999, Michael A. Hess wrote:

> michael at tfdec1.fys.kuleuven.ac.be wrote:
> > 
> > > Hey Michael V. what is the status of this? You said you would
> > > indicate when it has been committed and working.
> > 
> > It has been there for more than a week now. You should be able to use
> > it. (I honestly thought I notified the list about it)
> 
> Maybe you did and I missed it. I tried to use it before I sent the email
> asking you this and it doesn't seem to work.
> 
> I have added a procedure to a class such as
> 
> procedure something; message '{thesignal}';
> 

the following should compile:

------------------------------------------------------

program testit;

Type TMyObject = Class (Tobject)
       A : Integer;
       Procedure DoClick (Var B : Integer; Self : TMyObject); message 'click';
       end;

Procedure TMyObject.DoClick (Var B : Integer; Self : TMyObject);

begin
  Writeln ('B : ',B);
  Writeln ('A : ',A);
end;

Type TCallPRoc = Procedure (Var B: Integer; Obj : TMyObject) of object;

Var MyObject : TMyObject;
    MyProc : TCallProc;
    P : Pointer;
    
begin
  MyObject:=TMyObject.Create;
  MyObject.A:=1;
  // MyProc:=@MyObject.DoClick; 
  // MyProc(2,MyObject); 
  MyObject.Free;
end.

-----------------------------------------------------------------------

The two commented out lines don't compile yet, I'll have to ask Florian 
about them. But the above compiles with todays compiler, and with last
weeks too.

I'll let you know when the two lines can be uncommented :-)

Michael.






More information about the Lazarus mailing list