[Lazarus] run-time vs desgin-time packages
Mattias Gaertner
nc-gaertnma at netcologne.de
Sun Nov 15 12:09:54 CET 2009
On Sat, 14 Nov 2009 17:31:07 +0000
Martin <lazarus at mfriebe.de> wrote:
> Mattias Gaertner wrote:
> > On Sat, 14 Nov 2009 17:27:07 +0200
> > ik <idokan at gmail.com> wrote:
> >
> >
> >> Hello,
> >>
> >> I'm trying to explain desgin-time vs run-time packages, and it seems
> >> that I don't really fully understand them myself.
> >> Desgin time are packages that changes the IDE or adds components
> >> etc... Run-time are used only when compiling the program itself.
> >>
> >> That much I understand (I hope). However, I can't install run-time
> >> packages, so how does Lazarus knows about them ?
> >>
> >
> > See
> > http://wiki.lazarus.freepascal.org/Lazarus_Packages#Design_Time_vs_Run_Time_package
> >
> This link seems to assume that a package is always either design, or
> runtime or both?
Correct.
> AFAIK: in delphi you can have the same package as onr runtime, and one
> design time package.
Same under lazarus. You can duplicate code and write any redundancy you
like. But I don't recommend it.
> That is you have TMyComponent. Instead of having any "if csDesigning in
> ComponetFlags" you have a designtime package (containing your
> component,with all tghe cdesign code, and maybe prop-editors or the
> like) and you have your runtime package, that has the same component,
> but without csdesign code.
That's possible. But I have hardly seen such duplication.
> Now yes: the ide only needs to know about the design package, in order
> for you to put the component on your page. => but in this case the IDE
> would add the design time package as package/unit requirements to your
> project. And it should not. It should add the runtime package instead.
Then the run time package "provides" the design time package (Package
Editor / Options / Provides).
> Maybe that is something that can be archive with build-modes? While
> compilng the IDE, you use the design-time build mode. While compiling an
> application you use the run-time build-mode. (The packages must have the
> ppu for both build-modes in it's unit directory).
Mattias
More information about the Lazarus
mailing list