[Lazarus] Package directory at runtime

Mattias Gaertner nc-gaertnma at netcologne.de
Fri May 11 18:07:57 CEST 2012


On Fri, 11 May 2012 18:01:32 +0200
Krzysztof <dibo20 at wp.pl> wrote:

> Hmm. Is an easier way? The point is that my package with visual
> controls, has subcatalog "styles". In design mode, when user open
> style manager (double click on control) then I would like to display
> all files in that directory. For the first time I could ask the user
> for the path to the package, but where then save this path? In
> Lazarus's home directory?

At designtime you can find the package directory easily:

uses MacroIntf; // package IDEIntf

  Dir:='$PkgDir(YourPkgName)';
  IDEMacros.SubstituteMacros(Dir);

Mattias




More information about the Lazarus mailing list