[Lazarus] global items in TApplication

Marc Santhoff M.Santhoff at web.de
Sun Sep 15 16:24:16 CEST 2013


On Sa, 2013-09-14 at 21:24 -0700, leledumbo wrote:
> In short, you can't put it in the .dpr if you want it to be accessible from
> all units. Actually, there's not really any magic behind TApplication, you
> can still create your own TApplication descendant (preferably in its own
> unit) and assign that to Application variable. Provide a global property to
> access Application as your TApplication descendant to get its specific
> features.

I can, but then I'd have to choose one of two solutions I don't like:
having to free the automatically created TApplication object or change
forms.pp.

> A single unit that is set as application configuration is
> good enough.

That's a god idea, one single globals unit but not having them in the
main program source. Having all in one place is OK for programmes to get
a quick overview and one spot where to look.

Thanks!

-- 
Marc Santhoff <M.Santhoff at web.de>





More information about the Lazarus mailing list