[lazarus] Creating Components...

Jeffrey A. Wormsley daworm at cdc.net
Wed Aug 11 23:50:38 EDT 1999


On 8/11/99, at 9:54 PM, Shane Miller wrote: 

>The button is created in the Forms OnCreate?  The Button is created where
>ever the user puts the Button := TButton.Create(Owner).  Owner is set to
the
>Form that the TButton is owned by.

I meant to say in the Form's constructor.  The actual call is 

button1 := TButton.Create(Self);

I tried changing it to 

button1 := TButton.Create(Hello); (Hello is tha name of the form).

With the new compiler, I changed it back.

>The button should have it's parent assigned already in Control.Create or
>TWinControl.Create.

Parent is assigned to the button's Self.

>You may need to look at the difference of "owner" and "Parent".  Parent is
>used in TControl to hold the TWinControl I believe, so I think you should
>use owner.

Owner is set correctly, with the new compiler.

Things are moving along better, but I am still sleepy.

Good night.

Jeff






More information about the Lazarus mailing list