[Lazarus] Sample code needed to create form at runtime only (see mock up below).

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Sep 6 05:44:30 CEST 2010

Dimitri Smits schrieb:

> you've got to love the IDE experts like GExperts in Delphi. There you
> define your form as you want it to be through the editor and then
> "export to code". In other words, a kind of "dfm"-writer that writes
> creation-initialization code in objpas/fpc-code to the clipboard.

This is how most *other* GUI designers work, lacking any useful *visual* 
form designer. In contrast Delphi allows to even create forms etc. at 
runtime, by using LoadComponentRes with e.g. an DFM file (not sure about 
the correct name). This approach allows to e.g. update the appearance of 
entire forms, without recompilation of the EXE, by only distributing new 
DFM files to the users. Dunno about equivalent Lazarus support...

But the preference of concrete code vs. abstract form descriptions is a 
matter of taste and habits. I for my part don't understand how one ever 
wants to write code for a GUI design, when the GUI also can be 
constructed in different, more intuitive and reusable form.


More information about the Lazarus mailing list