[lazarus] Problem found

Ove Kaaven ovek at arcticnet.no
Tue Jun 29 12:38:03 EDT 1999



On Tue, 29 Jun 1999, Peter Vreman wrote:

> > Thanks for the idea.  I was hoping to find a "Delphi-like" way of
> > handling it.  By doing that I would need to set Self = the gtk object
> > data and that (I think) would start to cause some trouble when I wanted
> > to remove the code from the units and place them into seperate units for
> > GTK..... 
...
> the problem with signal and methods is that C doesn't know that it need to
> load the object pointer into ESI before calling to method, so it's not
> possible directly. Maybe with a wrapper it could be possible

Well, Delphi has the same problem under Windows, since window procedures
isn't called with a self pointer (only the window handle). Frameworks
(like VCL) solves that by using thunks (wrappers); often, these can be a
code fragment allocated on the heap that is written to pass an extra
argument along, or it can be a normal routine that looks the window
handle/widget pointer in some table and finds the associated object,
calling the proper method in it.






More information about the Lazarus mailing list