[Lazarus] Some thoughts about the global 'Application' instance.
Martin Friebe
lazarus at mfriebe.de
Thu Jun 18 16:40:44 CEST 2009
Graeme Geldenhuys wrote:
> Joost van der Sluis wrote:
>
>> Can we move this functionality to the CustApp unit? That way you can
>> always refer to custapp.Application and you have the 'current'
>> application instance.
>>
>
> Without looking at the code, this sounds like a better plan. I can't
> remember the exact details (it was very long ago), but I do remember I
> hit a similar issue in fpGUI Toolkit, and instead implemented my own
> fpgApplication singleton, which descended directly from TComponent to
> overcome the issue.
>
> Being able to go back to TCustomApplication included in FPC would be
> nice. Not to mention the more well known Application instance instead of
> fpgApplication instance.
>
Maybe a solution would be to remove the dependence on Forms, from the
interface unit?
there are 2 methods called:
procedure CreateWidgetset(AWidgetsetClass: TWidgetsetClass);
procedure FreeWidgetSet;
The first one doesn't actually need to be in Forms.
The 2nd (FreeWidgetSet) currently destroys all the global stuff that
depends on the interface, so this destruction would have to be done in a
different way.
For Example Screens or the Application Object itself.
If the Forms unit included the InterFace Unit (or some
TheUnitThatContainsCreateAndFreeWidgetSet) then the Forms unit could
register all the objects that needs destruction on FreeWidgetSet.
That should solve this.
Martin
More information about the Lazarus
mailing list