[lazarus] create

Michael A. Hess mhess at miraclec.com
Tue May 18 20:29:07 EDT 1999


Sergio A. Kessler wrote:
> 
> Cliff, in open source proyects centralizing things is a bad idea...

I have to agree with Sergio on this one. At least as far as the future
goes. To use Delphi as an example, I have created a host of new and
useful components and controls but have never had to edit any of the
Delphi VCL to do it. We want the same functionality in the FCL. That is
one reason why I am working on moving the gtk OUT of the lower class
structures. This allows users to not only create new components and
controls without touching the basic FCL but it allows them to use a
totally different GUI API to do so. Maybe QT has a built in widget that
they want to create a FCL control of. It would mean compiling with the
GUIAPI.pp designed for QT and create and new class without the need to
edit any of the lower classes in the FCL.

Now we go back to the discussion of "Is it time to worry about this
yet". I say no. It is something we want to keep in mind and plan on
going back and doing but right now we need a working IDE. Once we have A
BETTER environment to work in then I say we stop go back and smooth out
all the rough edges in our hasty design and build of the IDE.

Just to show you what I am working on as far as moving the gtk callback
out of the classes. This is how it will work, I'll use DoShow as an
example.

You create a message procedure in your class.

procedure DoShow(var something, Self : TCustomForm);message 'show';

Then you write the procedure:

procedure DoShow(var something, Self : TCustomForm);
begin
   if Assigned(FOnShow) then FOnShow(Self); 
end;

In the create for the class you write:

constructor TCustomForm.Create(AOwner : TComponent);
begin
.
.  Everything else you do need in create
.
.

{Then you do this for the callback attachment}

   GUIAPI_Set_Callback('show', Self);   

end;


You will only need the procedure with message 'signal', the procedure
itself and the GUIAPI call. This will allow you to use any GUIAPI to
deal with the actual callback. It removes gtk dependence.

The only snag I have in this whole thing is that the DispatchStr method
in TObject doesn't seem to be working correctly and I am just waiting
and hoping one of the FPC gods/gurus/omnipotent beings can figure out
what the problem is.   :-)

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list