[lazarus] LCL circles

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Oct 25 11:01:57 EDT 2002


On Fri, 25 Oct 2002 16:32:01 +0200
"Marc Weustink" <marc.weustink at cuperus.nl> wrote:

> + From: Mattias Gaertner [mailto:nc-gaertnma at netcologne.de]
> 
> [SNIP]
> 
> + > It is not realy a forbindden circle, more an unwanted circle.
> + >
> + > Forms reffered to iterfaces in its implementation section.
> +
> + You are right. Sorry.
> + But fact is, that fpc is not able to compile the LCL and the
> + gtk-interfaces in one go.
> + Just copy all units into one directory and fpc will show you what it
> + things about all this loops:
> +
> + [...]
> + Compiling interfaces.pp
> + Compiling interfacebase.pp
> + interfaces.pp(34,21) Error: Identifier not found TINTERFACEBASE
> + interfaces.pp(34,35) Error: Error in type definition
> 
> Hmm.... thats new to me (I've to admit that I haven't tried it ever
> after it was splitted)
> 
> + > + The advantage of this trick is:
> + > + - In the program source (.lpr) you don't need to add
> 'interfaces'.+ > +
> + > + The disadvantages of this trick are:
> + > + - The interfaces.pp must be compiled several times to make sure,
> + > +   that the compiler syncs all units. This is the reason, why you
> + > +   can't add lcl and lcl/interfaces/gtk to the unitpath.
> + >
> + > For normal apps, this shouldn't be a problem.
> +
> + Right.
> + The problem is of course, that _if_ someone does it he got strange
> + errors. Therefore we had to add several FAQs to make sure that no
> one+ run into this trap. And also we added Template paths to the IDE
> so that+ newbies don't try.
> 
> It is the same for Delphi if you add your VCL sources to your search
> path instead of your browse path.

I hope you don't want to say that we use the trick to be compatible to
Delphi. ;)

 
> + OTOH adding 'interfaces' to a file, that is normally auto created by
> the+ IDE is also not a problem.
> +
> +
> + > The reason for the construction as it is now is pure historical.
> While+ > the project grew,  more and more knowledge of the LCL was
> needed in+ > the interface {*}. Since we were developing only for a
> GTK set, this+ > could be compiled in one go (interface and LCL).
> + > Problem introduced here is that one needs a compiled LCL for every
> + > widgedset. So if one wants to make an app for different
> widgetsets,+ > one has to have all the different binary LCL's. With
> the current+ > solution one has one LCL (and onle different interface
> units)+
> + I think, your statement could be misinterpreted by newbies as if we
> + _must_ use the current construction to separate the LCL from the
> + interfaces. This is not the case. We can compile the LCL without
> + interfaces.pp and use only interfacebase.pp.
> 
> Hmm... isn't that what I was trying to tell... :-)

Hope so. :)
You know, one year ago I sent you a mail, describing how to break the
LCL<->interface circle. It was a matter of minutes. But at the time it
seemed just one circle out of hundreds.


> + > {*} And still IMO when the interface has more common functions
> and/or+ > events the interface doesn't have to know anything about the
> LCL. And+ > there would be no circle.
> +
> + Why that? The LCL has its abstract interface. So, why should the
> + interface not ly above the LCL and use it?
> 
> To avoid circles ?
> 
> Hmm... now you say so... since we are using an abstract interface why
> do we have a circle ? 

Lazyness.


> Maybe I should stop getting machines crashed, so that I can
> go back to coding :)
> 
> Marc (just recovered a box from a hardcrash)

:)

Mattias






More information about the Lazarus mailing list