[Lazarus] gtk2 warning

Lord Satan reimgrab at web.de
Mon Jun 22 13:15:09 CEST 2009


On Sun, 21 Jun 2009 22:26:15 +0100
Martin Friebe <lazarus at mfriebe.de> wrote:

>[...]
> The beginning of this thread was, that 2 applications existed,
> because the developer was *forced* to included "interfaces":
> 
> Jost wrote in the initial mail of this thread:
> > I always thought that an application always had one
> > Application-instance from the TCustomAppliction class. But at this
> > moment this is not the case for fcl-web applications, or
> > daemon-applications which are using Lazarus-forms.

Whoever wants to continue this thread: Please give an example for a
fcl-web application or daemon-application which is using Lazarus-forms.


> ....
> > But nowadays we are forced to include the 'interfaces' unit, which
> > uses the 'forms' unit which has it's own global Application
> > variable. So there are two TCustomApplication descdendents
> > initialized during the program!
> 
> Somehow the whole thread then picked up, the first half of this, and 
> everyone started to discuss (at least this is the impression I got, 
> apologies, if I overlooked anything) , how you could avoid having the 
> application from the Forms unit, even if you use that unit (because 
> apparently you have to). So the forms unit would have to detect the 
> presence of another application....

And this is what I don't understand.
What part of unit "forms" is needed that does not require the
widgetset?

 
> But all this only means work around the consequences, instead of 
> tackling the cause.
> 
> If I understand correctly, Interfaces now needs to be there, because
> of the smart-link - linker-alias trick used to reduce the exe size.

No. Unit interfaces was needed since the beginning. 
Before the change it was possible to avoid interfaces if:
- you use only constants and utility functions of the forms/controls
  unit.
- or if you use only the most basic things of TApplication, which
  already exist in TCustomApplication.

There are some LCL units which do not require the widgetset. Forms was
never one of them.
See the unit alllclunits for the dependencies.


> I haven't verified this. I would normally assume this should only be 
> needed, if you do use anything that uses the widgetset, and I did
> hope that if you do not touch anything widget related, you should
> still be able to compile without even using interfaces.
> However the whole last sentence may be taken once more to the test,
> if for some reason you do not smart-link your application.
> 
> In any case. as far as I am concerned there is no point in having any 
> checks in Forms, or any other unit, to detect a multiple application 
> situation. It comes down to *not* using units that would cause this.
>
> And if indeed there is a situation where dependencies force you to do
> so (which is what I thought the initial mail suggested, despite my 
> disbelieve), then the discussion should go how this dependencies can
> be broken. So no one is forced to use anything they do not want or
> need.

Please give at least one good practical example before starting
theoretical discussions how to restructure the FCL/LCL.


Mattias




More information about the Lazarus mailing list