[lazarus] the party can start ;)
Sergio Kessler
sak at perio.unlp.edu.ar
Tue May 18 13:31:15 EDT 1999
"Michael A. Hess" wrote:
>
> Peter Vreman wrote:
> >
> > I don't know much about the classes so you need to provide examples of
> > code which doesn't work
>
> OK here is the same example I sent to Michael V. He indicated that I am
> trying to use it correctly but this example will die big time when you
> try and run it.
>
> I have also found that the procedure setup as a message MUST have a
> leading variable before the Self. For example I have placed
> var b : integer
> first. If I don't do this then the compiler dies big time to the point
> of blowing away the terminal I am working in. What I don't understand is
> how you are suppose to use this leading variable. The DispatchStr
> doesn't seem to make any use of it and I can't see how you are suppose
> to supply data for this variable in a call.
>
> Maybe you can explain it to me. :-)
>
> program test;
>
> {$mode objfpc}
>
> type
> TMyObject = Class (Tobject)
> procedure DoClick(var b : integer; Self : TMyObject); message
> 'click';
> procedure Test;
> end;
>
> procedure TMyObject.DoClick(var b : integer; Self : TMyObject);
> begin
> writeln ('Called DoClick');
> end;
>
> procedure TMyObject.Test;
> var
> msg : string;
> begin
> msg := 'click';
> DispatchStr(msg);
> end;
>
> var
> MyObject : TMyObject;
>
> begin
> MyObject:=TMyObject.Create;
> MyObject.Test;
> MyObject.Free;
> end.
ok, you call DispatchStr(msg); then how gtk is called ?
--
| Sergio A. Kessler http://perio.unlp.edu.ar/~sergio
-O_O- Keep working at it... you will either succeed, or become an
expert.
More information about the Lazarus
mailing list