AW: [lazarus] LFM Files again ;)

Sebastian Günther sguenther at
Fri Oct 13 05:55:58 EDT 2000

Mattias Gaertner wrote:
> >If you want to write an object inspector, you don't need the DFM layout. You
> >can make object inspector based upon the RTTI info.
> The Object inspector needs the RTTI. This is a fact.

But this is what everybody already said.

> But as far as I have seen: The RTTI can't store the values in the program on
> disk, can it?

Sorry but it seems that you don't really know what RTTI is about: RTTI,
the Run Time Type Informations, is just a concept for being able to
access informations about types (such as classes) at runtime of a
program. More concrete, for classes this means that you can get a list
of all published properties and methods at runtime, together with
informations about all referenced types.

> Under Delphi changed values are stored in the DFM file and compiled in via the
> {$R *.DFM} directive. Which is a much better solution than to store it in the
> Form.Create method (see examples).

This is not very exact: Delphi creates an instance of the form in the
designer, i.e. a TForm object. This object and all of the components it
contains have RTTI informations. Delphi then just uses the functions of
the TypInfo unit (also available in FPC) to read and write the
properties of the components. When you save the form, the form object is
serialized (streamed), and when you re-open the form, it creates an
empty TForm object and loads the object state from the previously
created stream.

- Sebastian

More information about the Lazarus mailing list