Fixed: Hello WAS: Re: [lazarus] Editor crashing when adding text

Marc Weustink Marc.Weustink at cuperus.nl
Tue Dec 7 09:13:55 EST 1999


+ From: Samuel Liddicott [mailto:sam at campbellsci.co.uk]
+
+ > -----Original Message-----
+ > From: vital at videotron.ca [mailto:vital at videotron.ca]
+ >
+ > At 02:24 99-12-07 +0100, I wrote:
+ > >
+ > >Ah, thats an easy one.
+ > >
+ > >Since now (or for while), to show a control is has to have
+ > >at least a
+ > >Parent. In the past the owner was erroneous used as a parent.
+ > (The owner is
+ > >the VCL/LCL class owner, not the graphical owner). Thats
+ > >why the button
+ > >doid show up in the past and didnt till now.
+ > >(You can try to create a button without parent in Delphi!)
+ > >
+ > >Marc
+ >
+ > Marc, you obsolutly need a parent in Delphi else you raise
+ > an exception.
+
+ You don't have to raise an exception.  I sometimes have controls about
+ without parents.  Of course they are not visible, I set the
+ parent when and
+ where I want them to appear.
+
+ I also often change the parent during runtime to make controls appear
+ somewhere else (hence need for destroywnd and createwnd)

You only get an exeption if you want the handle of your control when it has
no parent. And as far as I can recall in Lazarus it is the same.
As long as you don't need the handle (IE, the physical component) it is OK
to have no parent.

Marc







More information about the Lazarus mailing list