Creating a component lazarus / 31-LCL ---------------------------------------------------------------------- Pascaluvr · 2013-07-08 04:36 I have seen references of how to create a component - but what I haven't found is how to first build a unit as a possible component and later make it one. I am sure there must be a methodology - rebuilding Lazarus for every tiny change during development doesn't seem very productive to me.   Has anyone got a link to guide me? Thanks in advance ---------------------------------------------------------------------- taazz · 2013-07-08 05:12 I'm not sure I understand you correctly but here it goes. I suppose you already know which is the ancestor of your component. Create a new application in lazarus. place the ancestor on the main form. note the units that are added on the main form and delete the component. go to the file\new unit and save it under a name that you easely later on understand what is in there. add the units in the interface section uses clause. right below the the uses clause type the following Code: [Select]type   TMyNewComponent = class(TComponent)   end; that's it you now have the template to work on your component, well almost you need to be able to see the component in action and debug it with out installing. Go back to the main form the IDE created for you. double click the form to create a onCreate eventt and in there you type, Code: [Select]With TMyComponent.Create(self) do begin   Left := 10;   Top := 10;   Width := 250;   Height := 40;   ... set any other properties you need to test   parent := self; end; Ready you now have a testbed for your new component press F9 and start debugging. ---------------------------------------------------------------------- Pascaluvr · 2013-07-08 06:20 Thanks taazz - yes you understood my question.  Its still a little vague to me, but I get the idea ...   I now have  starting point to start experimenting and exploring to learn a new skill. Thank again ---------------------------------------------------------------------- typo · 2013-07-08 10:40 Unfortunatelly you will have to rebuild Lazarus at every time you need to see how your changes behave at design time. For the behavior at run time maybe will be enough to rebuild your project (Project > Clean up and Rebuild). It is not so different with Delphi, you would need to rebuild the library at every step. ---------------------------------------------------------------------- Blaazen · 2013-07-08 11:04 QuoteI am sure there must be a methodology - rebuilding Lazarus for every tiny change during development doesn't seem very productive to me.You should create your component at runtime during development. You should make a test application with using RTTI. It is so easy to link your component to TTIPropertyGrid - just one line of code! See: lazarus/examples/groupedcontrol/editbuttonunit1.pas You need rebuilding Lazarus only when you need to test how your component behaves at design-time in Form Editor and if your component is correctly added to component palette (with right icon, on right position etc.). But even if you rebuild Lazarus in this case, it will take no more than a few seconds, because it is not "make clean" and only changed units are recompiled. Other units are already compiled (*.ppu, *.o files) so executable is built very quickly. ---------------------------------------------------------------------- typo · 2013-07-08 11:22 As far as you can, create a package with your unit in order to compile it more quickly than rebuilding entire Lazarus. Compiling and reinstalling the package is equivalent to rebuld Lazarus for the scope of your component. ---------------------------------------------------------------------- Pascaluvr · 2013-07-09 01:36 Thanks for the replies It will take me a while but I'm slowly getting there. My head still spins on a regular basis and it will be quite a while before I can create a 'real' component that may be useful to others - but I do appreciate all the help to get me started.