Difference between revisions of "Register (package)"

From Lazarus wiki
Line 28: Line 28:
  
 
initialization
 
initialization
 +
  {$I myresourcefile.lrs}
 +
 
   RegisterPackage( 'MyTab', @Register );
 
   RegisterPackage( 'MyTab', @Register );
 
end.
 
end.

Revision as of 21:13, 20 July 2016

A Lazarus package that is intended to be installed needs a Register procedure which declares

  • all the package components and corresponding files
  • the tab on which the components are to be located.

Related procedures/functions

unit RegisterMyPackage;

interface

  uses 
    LazarusPackageIntf, MyPackage1, MyPackage2, MyOtherPackage;

implementation

procedure Register;
begin
  RegisterUnit( 'MyTab', @MyPackage1.Register );
  RegisterUnit( 'MyTab', @MyPackage2.Register );
  RegisterComponents( 'OtherTab', [TOtherComponent1,TOtherComponent2] );
end;

initialization
  {$I myresourcefile.lrs}

  RegisterPackage( 'MyTab', @Register );
end.